cone 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f3ecb3a178ffc78d09101d167c0338db456c3c8
4
- data.tar.gz: b8734f2c8fe6f9c50581c35e773133181028cad2
3
+ metadata.gz: 8dfc31078d447ab6188e4f842b480b870b5c564b
4
+ data.tar.gz: 4bf4c87d492866bc694862cf23cc377647e2411f
5
5
  SHA512:
6
- metadata.gz: ebc648ceb2d5d28780be2a189922ac2e01cc05ea80fe909e8b093277622c553d43db02074ed06ed9d18845b3f2b3de6ece20bcf2ce1574ead0dbf3e3e58e6eba
7
- data.tar.gz: 7d09575d924b4b3e1a21830eb110988a1338676aab1a77f3664a6cc4ccbfb73b5198a1f592d6315043ee98bdb30b346cb57cd2ed8f6d72e18b4e6fb798bbea5c
6
+ metadata.gz: 822362cf5b235595126b91d59284425d5ce32e045250beec28c3a754684afaff97d4a767f026cf9149175216b980df88f470afc1155b62d45d05734dc90d094c
7
+ data.tar.gz: cb36210caf836249dbae53d9c769f035f464df89d6d35893e88ad91262074f43f8d6f0aca4524845060a5e3384df7c85c3843741fe07f507ce1762ac672ce938
data/cone.gemspec CHANGED
@@ -1,12 +1,13 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'cone'
3
- gem.version = '0.1.0'
3
+ gem.version = '0.2.0'
4
4
  gem.summary = 'Rails client side URL helpers'
5
5
  gem.author = 'Lihan Li'
6
6
  gem.email = 'frankieteardrop@gmail.com'
7
7
  gem.homepage = 'http://github.com/lihanli/cone'
8
8
 
9
9
  gem.add_dependency('coffee-rails')
10
+ gem.add_dependency('railties', '~> 5.0')
10
11
 
11
12
  gem.files = `git ls-files`.split("\n")
12
13
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -17,9 +17,10 @@ processPath = (path, params = {}) ->
17
17
  path
18
18
 
19
19
  @cone =
20
- <% Rails.application.routes.routes.named_routes.each do |route_name, route_val| %>
20
+ <% Rails.application.routes.routes.anchored_routes.each do |route| %>
21
+ <% route_name = route.name %>
22
+ <% next if route_name.nil? %>
21
23
 
22
24
  <%= route_name.camelize(:lower) %>Path: (params) ->
23
- processPath(<%= route_val.path.spec.to_s.to_json %>, params)
24
-
25
- <% end %>
25
+ processPath(<%= route.path.spec.to_s.to_json %>, params)
26
+ <% end %>
data/test/Gemfile CHANGED
@@ -1,12 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '4.2.6'
3
+ gem 'rails', '5.0.0'
4
4
  gem 'cone', path: '..'
5
5
 
6
6
  group :development, :test do
7
7
  gem 'thin'
8
8
  gem 'pry-rails'
9
- gem 'capybara', '2.2.1'
10
- gem 'selenium-webdriver', '2.53.0'
9
+ gem 'capybara', '2.7.1'
10
+ gem 'selenium-webdriver', '2.53.4'
11
11
  gem 'minitest-reporters', '1.0.8'
12
12
  end
data/test/Gemfile.lock CHANGED
@@ -1,51 +1,56 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- cone (0.1.0)
4
+ cone (0.2.0)
5
5
  coffee-rails
6
+ railties (~> 5.0)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
- actionmailer (4.2.6)
11
- actionpack (= 4.2.6)
12
- actionview (= 4.2.6)
13
- activejob (= 4.2.6)
11
+ actioncable (5.0.0)
12
+ actionpack (= 5.0.0)
13
+ nio4r (~> 1.2)
14
+ websocket-driver (~> 0.6.1)
15
+ actionmailer (5.0.0)
16
+ actionpack (= 5.0.0)
17
+ actionview (= 5.0.0)
18
+ activejob (= 5.0.0)
14
19
  mail (~> 2.5, >= 2.5.4)
15
- rails-dom-testing (~> 1.0, >= 1.0.5)
16
- actionpack (4.2.6)
17
- actionview (= 4.2.6)
18
- activesupport (= 4.2.6)
19
- rack (~> 1.6)
20
- rack-test (~> 0.6.2)
21
- rails-dom-testing (~> 1.0, >= 1.0.5)
20
+ rails-dom-testing (~> 2.0)
21
+ actionpack (5.0.0)
22
+ actionview (= 5.0.0)
23
+ activesupport (= 5.0.0)
24
+ rack (~> 2.0)
25
+ rack-test (~> 0.6.3)
26
+ rails-dom-testing (~> 2.0)
22
27
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
- actionview (4.2.6)
24
- activesupport (= 4.2.6)
28
+ actionview (5.0.0)
29
+ activesupport (= 5.0.0)
25
30
  builder (~> 3.1)
26
31
  erubis (~> 2.7.0)
27
- rails-dom-testing (~> 1.0, >= 1.0.5)
32
+ rails-dom-testing (~> 2.0)
28
33
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- activejob (4.2.6)
30
- activesupport (= 4.2.6)
31
- globalid (>= 0.3.0)
32
- activemodel (4.2.6)
33
- activesupport (= 4.2.6)
34
- builder (~> 3.1)
35
- activerecord (4.2.6)
36
- activemodel (= 4.2.6)
37
- activesupport (= 4.2.6)
38
- arel (~> 6.0)
39
- activesupport (4.2.6)
34
+ activejob (5.0.0)
35
+ activesupport (= 5.0.0)
36
+ globalid (>= 0.3.6)
37
+ activemodel (5.0.0)
38
+ activesupport (= 5.0.0)
39
+ activerecord (5.0.0)
40
+ activemodel (= 5.0.0)
41
+ activesupport (= 5.0.0)
42
+ arel (~> 7.0)
43
+ activesupport (5.0.0)
44
+ concurrent-ruby (~> 1.0, >= 1.0.2)
40
45
  i18n (~> 0.7)
41
- json (~> 1.7, >= 1.7.7)
42
46
  minitest (~> 5.1)
43
- thread_safe (~> 0.3, >= 0.3.4)
44
47
  tzinfo (~> 1.1)
48
+ addressable (2.4.0)
45
49
  ansi (1.5.0)
46
- arel (6.0.3)
50
+ arel (7.0.0)
47
51
  builder (3.2.2)
48
- capybara (2.2.1)
52
+ capybara (2.7.1)
53
+ addressable
49
54
  mime-types (>= 1.16)
50
55
  nokogiri (>= 1.3.3)
51
56
  rack (>= 1.0.0)
@@ -54,9 +59,9 @@ GEM
54
59
  childprocess (0.5.9)
55
60
  ffi (~> 1.0, >= 1.0.11)
56
61
  coderay (1.1.1)
57
- coffee-rails (4.1.1)
62
+ coffee-rails (4.2.1)
58
63
  coffee-script (>= 2.2.0)
59
- railties (>= 4.0.0, < 5.1.x)
64
+ railties (>= 4.0.0, < 5.2.x)
60
65
  coffee-script (2.4.1)
61
66
  coffee-script-source
62
67
  execjs
@@ -65,86 +70,90 @@ GEM
65
70
  daemons (1.2.3)
66
71
  erubis (2.7.0)
67
72
  eventmachine (1.2.0.1)
68
- execjs (2.6.0)
69
- ffi (1.9.10)
73
+ execjs (2.7.0)
74
+ ffi (1.9.14)
70
75
  globalid (0.3.6)
71
76
  activesupport (>= 4.1.0)
72
77
  i18n (0.7.0)
73
- json (1.8.3)
74
78
  loofah (2.0.3)
75
79
  nokogiri (>= 1.5.9)
76
80
  mail (2.6.4)
77
81
  mime-types (>= 1.16, < 4)
78
82
  method_source (0.8.2)
79
- mime-types (3.0)
83
+ mime-types (3.1)
80
84
  mime-types-data (~> 3.2015)
81
- mime-types-data (3.2016.0221)
82
- mini_portile2 (2.0.0)
85
+ mime-types-data (3.2016.0521)
86
+ mini_portile2 (2.1.0)
83
87
  minitest (5.9.0)
84
88
  minitest-reporters (1.0.8)
85
89
  ansi
86
90
  builder
87
91
  minitest (>= 5.0)
88
92
  ruby-progressbar
89
- nokogiri (1.6.7.2)
90
- mini_portile2 (~> 2.0.0.rc2)
91
- pry (0.10.3)
93
+ nio4r (1.2.1)
94
+ nokogiri (1.6.8)
95
+ mini_portile2 (~> 2.1.0)
96
+ pkg-config (~> 1.1.7)
97
+ pkg-config (1.1.7)
98
+ pry (0.10.4)
92
99
  coderay (~> 1.1.0)
93
100
  method_source (~> 0.8.1)
94
101
  slop (~> 3.4)
95
102
  pry-rails (0.3.4)
96
103
  pry (>= 0.9.10)
97
- rack (1.6.4)
104
+ rack (2.0.1)
98
105
  rack-test (0.6.3)
99
106
  rack (>= 1.0)
100
- rails (4.2.6)
101
- actionmailer (= 4.2.6)
102
- actionpack (= 4.2.6)
103
- actionview (= 4.2.6)
104
- activejob (= 4.2.6)
105
- activemodel (= 4.2.6)
106
- activerecord (= 4.2.6)
107
- activesupport (= 4.2.6)
107
+ rails (5.0.0)
108
+ actioncable (= 5.0.0)
109
+ actionmailer (= 5.0.0)
110
+ actionpack (= 5.0.0)
111
+ actionview (= 5.0.0)
112
+ activejob (= 5.0.0)
113
+ activemodel (= 5.0.0)
114
+ activerecord (= 5.0.0)
115
+ activesupport (= 5.0.0)
108
116
  bundler (>= 1.3.0, < 2.0)
109
- railties (= 4.2.6)
110
- sprockets-rails
111
- rails-deprecated_sanitizer (1.0.3)
112
- activesupport (>= 4.2.0.alpha)
113
- rails-dom-testing (1.0.7)
114
- activesupport (>= 4.2.0.beta, < 5.0)
117
+ railties (= 5.0.0)
118
+ sprockets-rails (>= 2.0.0)
119
+ rails-dom-testing (2.0.1)
120
+ activesupport (>= 4.2.0, < 6.0)
115
121
  nokogiri (~> 1.6.0)
116
- rails-deprecated_sanitizer (>= 1.0.1)
117
122
  rails-html-sanitizer (1.0.3)
118
123
  loofah (~> 2.0)
119
- railties (4.2.6)
120
- actionpack (= 4.2.6)
121
- activesupport (= 4.2.6)
124
+ railties (5.0.0)
125
+ actionpack (= 5.0.0)
126
+ activesupport (= 5.0.0)
127
+ method_source
122
128
  rake (>= 0.8.7)
123
129
  thor (>= 0.18.1, < 2.0)
124
- rake (11.1.2)
130
+ rake (11.2.2)
125
131
  ruby-progressbar (1.8.1)
126
132
  rubyzip (1.2.0)
127
- selenium-webdriver (2.53.0)
133
+ selenium-webdriver (2.53.4)
128
134
  childprocess (~> 0.5)
129
135
  rubyzip (~> 1.0)
130
136
  websocket (~> 1.0)
131
137
  slop (3.6.0)
132
- sprockets (3.6.0)
138
+ sprockets (3.6.3)
133
139
  concurrent-ruby (~> 1.0)
134
140
  rack (> 1, < 3)
135
- sprockets-rails (3.0.4)
141
+ sprockets-rails (3.1.1)
136
142
  actionpack (>= 4.0)
137
143
  activesupport (>= 4.0)
138
144
  sprockets (>= 3.0.0)
139
- thin (1.6.4)
145
+ thin (1.7.0)
140
146
  daemons (~> 1.0, >= 1.0.9)
141
147
  eventmachine (~> 1.0, >= 1.0.4)
142
- rack (~> 1.0)
148
+ rack (>= 1, < 3)
143
149
  thor (0.19.1)
144
150
  thread_safe (0.3.5)
145
151
  tzinfo (1.2.2)
146
152
  thread_safe (~> 0.1)
147
153
  websocket (1.2.3)
154
+ websocket-driver (0.6.4)
155
+ websocket-extensions (>= 0.1.0)
156
+ websocket-extensions (0.1.2)
148
157
  xpath (2.0.0)
149
158
  nokogiri (~> 1.3)
150
159
 
@@ -152,13 +161,13 @@ PLATFORMS
152
161
  ruby
153
162
 
154
163
  DEPENDENCIES
155
- capybara (= 2.2.1)
164
+ capybara (= 2.7.1)
156
165
  cone!
157
166
  minitest-reporters (= 1.0.8)
158
167
  pry-rails
159
- rails (= 4.2.6)
160
- selenium-webdriver (= 2.53.0)
168
+ rails (= 5.0.0)
169
+ selenium-webdriver (= 2.53.4)
161
170
  thin
162
171
 
163
172
  BUNDLED WITH
164
- 1.10.6
173
+ 1.12.4
@@ -9,8 +9,8 @@ ConeTest::Application.configure do
9
9
  config.cache_classes = true
10
10
 
11
11
  # Configure static asset server for tests with Cache-Control for performance
12
- config.serve_static_files = true
13
- config.static_cache_control = "public, max-age=3600"
12
+ config.public_file_server.enabled = true
13
+ config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
14
14
 
15
15
  # Show full error reports and disable caching
16
16
  config.consider_all_requests_local = true
@@ -1,12 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class ConeGemTest < ActionDispatch::IntegrationTest
4
- def setup
5
- assert(Dir["#{::Rails.application.config.instance_eval { @assets }[:cache_store][1]}*"].blank?) if Capybara::Server.ports.blank?
6
-
7
- super
8
- end
9
-
10
4
  def get_cone_url(name, opt = {})
11
5
  # alias, params
12
6
  get_js("cone.#{name}Path(#{ opt[:params] ? opt[:params].to_json : '' })")
@@ -27,4 +21,4 @@ class ConeGemTest < ActionDispatch::IntegrationTest
27
21
  assert_equal '/users/12/posts?foo=bar%20baz', get_cone_url('userPosts', params: {user_id: '12', foo: 'bar baz'})
28
22
  end
29
23
 
30
- end
24
+ end
@@ -10,11 +10,16 @@ class ActiveSupport::TestCase
10
10
  # Add more helper methods to be used by all tests here...
11
11
  end
12
12
 
13
+ Capybara.register_driver :chrome do |app|
14
+ Capybara::Selenium::Driver.new(app, :browser => :chrome)
15
+ end
16
+
13
17
  class ActionDispatch::IntegrationTest
14
18
  # Make the Capybara DSL available in all integration tests
15
19
  include Capybara::DSL
20
+
16
21
  def setup
17
- Capybara.current_driver = Capybara.javascript_driver
22
+ Capybara.current_driver = :chrome
18
23
  visit '/'
19
24
  end
20
25
 
@@ -25,4 +30,4 @@ class ActionDispatch::IntegrationTest
25
30
  def teardown
26
31
  Capybara.reset_sessions! # Forget the (simulated) browser state
27
32
  end
28
- end
33
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lihan Li
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-19 00:00:00.000000000 Z
11
+ date: 2016-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-rails
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: railties
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.0'
27
41
  description:
28
42
  email: frankieteardrop@gmail.com
29
43
  executables: []
@@ -106,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
120
  version: '0'
107
121
  requirements: []
108
122
  rubyforge_project:
109
- rubygems_version: 2.4.5.1
123
+ rubygems_version: 2.5.1
110
124
  signing_key:
111
125
  specification_version: 4
112
126
  summary: Rails client side URL helpers