Skip to content

Commit 762d503

Browse files
committed
updated hyper-router - need to add more specs
1 parent 2a1c83f commit 762d503

File tree

113 files changed

+1686
-194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1686
-194
lines changed

docs/dsl-client/hyper-router.md

Lines changed: 135 additions & 156 deletions
Large diffs are not rendered by default.

ruby/hyper-component/lib/hyperstack/internal/component/class_methods.rb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ def method_missing(name, *args, &children)
5252
end
5353

5454
def validator
55-
@validator ||= Validator.new(props_wrapper)
55+
return @validator if @validator
56+
if superclass.respond_to?(:validator)
57+
@validator = superclass.validator.copy(props_wrapper)
58+
else
59+
@validator = Validator.new(props_wrapper)
60+
end
5661
end
5762

5863
def prop_types
@@ -79,7 +84,12 @@ def params(&block)
7984
end
8085

8186
def props_wrapper
82-
@props_wrapper ||= Class.new(PropsWrapper)
87+
return @props_wrapper if @props_wrapper
88+
if superclass.respond_to? :props_wrapper
89+
@props_wrapper = Class.new(superclass.props_wrapper)
90+
else
91+
@props_wrapper ||= Class.new(PropsWrapper)
92+
end
8393
end
8494

8595
def param(*args)

ruby/hyper-component/lib/hyperstack/internal/component/validator.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@ module Hyperstack
22
module Internal
33
module Component
44
class Validator
5+
56
attr_accessor :errors
67
attr_reader :props_wrapper
78
private :errors, :props_wrapper
89

10+
def copy(new_props_wrapper)
11+
Validator.new(new_props_wrapper).tap do |c|
12+
%i[@allow_undefined_props @rules @errors].each do |var|
13+
c.instance_variable_set(var, instance_variable_get(var).dup)
14+
end
15+
end
16+
end
17+
918
def initialize(props_wrapper = Class.new(PropsWrapper))
1019
@props_wrapper = props_wrapper
1120
end

ruby/hyper-router-orig/.gitignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/.bundle/
2+
/.yardoc
3+
/Gemfile.lock
4+
/_yardoc/
5+
/coverage/
6+
/doc/
7+
/pkg/
8+
/spec/reports/
9+
/tmp/
10+
/spec/test_app/tmp/
11+
12+
13+
# Logs
14+
logs
15+
*.log
16+
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
22+
# Directory for instrumented libs generated by jscoverage/JSCover
23+
lib-cov
24+
25+
# Coverage directory used by tools like istanbul
26+
coverage
27+
28+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# node-waf configuration
32+
.lock-wscript
33+
34+
# Compiled binary addons (http://nodejs.org/api/addons.html)
35+
build/Release
36+
37+
# Dependency directory
38+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
39+
node_modules
40+
41+
# Ignore bundler config.
42+
.bundle
43+
44+
Gemfile.lock
45+
46+
# ignore gems
47+
*.gem
48+
49+
# ignore Idea
50+
.idea

ruby/hyper-router-orig/.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
language: ruby
2+
rvm:
3+
- ruby
4+
env:
5+
- HYPER_DEV_GEM_SOURCE="https://gems.ruby-hyperloop.org" TZ=Europe/Berlin
6+
before_install:
7+
- sudo apt-get install -y fonts-liberation
8+
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
9+
- sudo dpkg -i google-chrome*.deb
10+
- gem install bundler
11+
before_script:
12+
- cd spec/test_app
13+
- bundle update
14+
- bundle exec rails db:setup
15+
- cd ../../
16+
- chromedriver-update
17+
- ls -lR ~/.chromedriver-helper/
18+
script: bundle exec rspec
19+
gemfile:
20+
- gemfiles/opal_0_11_react-rails_2_4.gemfile

ruby/hyper-router-orig/Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source 'https://rubygems.org'
2+
#gem "opal-jquery", git: "https://github.com/opal/opal-jquery.git", branch: "master"
3+
gem 'hyper-spec', path: '../hyper-spec'
4+
gem 'hyperloop-config', path: '../hyperloop-config'
5+
gem 'hyper-store', path: '../hyper-store'
6+
gem 'hyper-component', path: '../hyper-component'
7+
gemspec

ruby/hyper-router-orig/Rakefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
require "bundler/gem_tasks"
2+
require "rspec/core/rake_task"
3+
4+
RSpec::Core::RakeTask.new(:spec)
5+
6+
namespace :spec do
7+
task :prepare do
8+
end
9+
end
10+
11+
task :default => :spec

ruby/hyper-router-orig/config.ru

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# config.ru
2+
require 'bundler'
3+
Bundler.require
4+
5+
require "opal-rspec"
6+
#require "react/source"
7+
8+
Opal.append_path File.expand_path('../spec', __FILE__)
9+
10+
run Opal::Server.new { |s|
11+
s.main = 'opal/rspec/sprockets_runner'
12+
s.append_path 'spec'
13+
#s.append_path File.dirname(::React::Source.bundled_path_for("react-with-addons.js"))
14+
s.debug = true
15+
s.index_path = 'spec/index.html.erb'
16+
}

0 commit comments

Comments
 (0)