strawberry_cough 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -4,8 +4,8 @@ gemspec
4
4
 
5
5
  gem 'rake'
6
6
 
7
- gem 'activesupport', '~> 3.1'
8
- gem 'railties', '~> 3.1'
7
+ gem 'activesupport', '~> 3.2'
8
+ gem 'railties', '~> 3.2'
9
9
  gem 'tilt'
10
10
  gem 'sprockets-rails'
11
11
 
data/Gemfile.lock CHANGED
@@ -6,74 +6,74 @@ PATH
6
6
  GEM
7
7
  remote: http://rubygems.org/
8
8
  specs:
9
- actionpack (3.1.1)
10
- activemodel (= 3.1.1)
11
- activesupport (= 3.1.1)
9
+ actionpack (3.2.8)
10
+ activemodel (= 3.2.8)
11
+ activesupport (= 3.2.8)
12
12
  builder (~> 3.0.0)
13
13
  erubis (~> 2.7.0)
14
- i18n (~> 0.6)
15
- rack (~> 1.3.2)
16
- rack-cache (~> 1.1)
17
- rack-mount (~> 0.8.2)
14
+ journey (~> 1.0.4)
15
+ rack (~> 1.4.0)
16
+ rack-cache (~> 1.2)
18
17
  rack-test (~> 0.6.1)
19
- sprockets (~> 2.0.2)
20
- activemodel (3.1.1)
21
- activesupport (= 3.1.1)
18
+ sprockets (~> 2.1.3)
19
+ activemodel (3.2.8)
20
+ activesupport (= 3.2.8)
22
21
  builder (~> 3.0.0)
22
+ activesupport (3.2.8)
23
23
  i18n (~> 0.6)
24
- activesupport (3.1.1)
25
24
  multi_json (~> 1.0)
26
- builder (3.0.0)
25
+ builder (3.0.4)
27
26
  diff-lcs (1.1.3)
28
27
  erubis (2.7.0)
29
28
  hike (1.2.1)
30
- i18n (0.6.0)
31
- json (1.6.1)
32
- multi_json (1.0.3)
33
- rack (1.3.5)
34
- rack-cache (1.1)
29
+ i18n (0.6.1)
30
+ journey (1.0.4)
31
+ json (1.7.5)
32
+ libv8 (3.3.10.4)
33
+ multi_json (1.3.6)
34
+ rack (1.4.1)
35
+ rack-cache (1.2)
35
36
  rack (>= 0.4)
36
- rack-mount (0.8.3)
37
- rack (>= 1.0.0)
38
37
  rack-ssl (1.3.2)
39
38
  rack
40
- rack-test (0.6.1)
39
+ rack-test (0.6.2)
41
40
  rack (>= 1.0)
42
- railties (3.1.1)
43
- actionpack (= 3.1.1)
44
- activesupport (= 3.1.1)
41
+ railties (3.2.8)
42
+ actionpack (= 3.2.8)
43
+ activesupport (= 3.2.8)
45
44
  rack-ssl (~> 1.3.2)
46
45
  rake (>= 0.8.7)
47
46
  rdoc (~> 3.4)
48
- thor (~> 0.14.6)
47
+ thor (>= 0.14.6, < 2.0)
49
48
  rake (0.9.2.2)
50
- rdoc (3.11)
49
+ rdoc (3.12)
51
50
  json (~> 1.4)
52
- rspec (2.7.0)
53
- rspec-core (~> 2.7.0)
54
- rspec-expectations (~> 2.7.0)
55
- rspec-mocks (~> 2.7.0)
56
- rspec-core (2.7.1)
57
- rspec-expectations (2.7.0)
58
- diff-lcs (~> 1.1.2)
59
- rspec-mocks (2.7.0)
60
- sprockets (2.0.3)
51
+ rspec (2.11.0)
52
+ rspec-core (~> 2.11.0)
53
+ rspec-expectations (~> 2.11.0)
54
+ rspec-mocks (~> 2.11.0)
55
+ rspec-core (2.11.1)
56
+ rspec-expectations (2.11.3)
57
+ diff-lcs (~> 1.1.3)
58
+ rspec-mocks (2.11.3)
59
+ sprockets (2.1.3)
61
60
  hike (~> 1.2)
62
61
  rack (~> 1.0)
63
62
  tilt (~> 1.1, != 1.3.0)
64
63
  sprockets-rails (0.0.1)
65
64
  sprockets (>= 1.0.2)
66
- therubyracer (0.8.1)
67
- thor (0.14.6)
65
+ therubyracer (0.10.2)
66
+ libv8 (~> 3.3.10)
67
+ thor (0.16.0)
68
68
  tilt (1.3.3)
69
69
 
70
70
  PLATFORMS
71
71
  ruby
72
72
 
73
73
  DEPENDENCIES
74
- activesupport (~> 3.1)
74
+ activesupport (~> 3.2)
75
75
  bundler (>= 1.0.0)
76
- railties (~> 3.1)
76
+ railties (~> 3.2)
77
77
  rake
78
78
  rspec
79
79
  sprockets-rails
data/README.md CHANGED
@@ -26,6 +26,10 @@ Installation
26
26
 
27
27
  To install, just add the following line to your Gemfile.
28
28
 
29
+ For Rails 3.1:
30
+ gem 'strawberry_cough', "= 0.2.0"
31
+
32
+ For Rails 3.2+:
29
33
  gem 'strawberry_cough'
30
34
 
31
35
  Then `//= require routes` in the JavaScript manifest file.
@@ -2,5 +2,5 @@ require 'strawberry_cough/version'
2
2
  require 'strawberry_cough/path_compiler'
3
3
  require 'strawberry_cough/path_parser'
4
4
  require 'strawberry_cough/routes_compiler'
5
- require 'strawberry_cough/rails/engine'
6
- require 'strawberry_cough/routes_js_template'
5
+ require 'strawberry_cough/rails/railtie'
6
+ require 'strawberry_cough/routes_js_template'
@@ -1,9 +1,14 @@
1
1
  require 'strawberry_cough/routes_compiler'
2
- require 'rails/engine'
2
+ require 'sprockets'
3
+ begin
4
+ require 'sprockets/railtie'
5
+ rescue LoadError
6
+ require 'sprockets/rails/railtie'
7
+ end
3
8
 
4
9
  module StrawberryCough
5
10
  module Rails
6
- class Engine < ::Rails::Engine
11
+ class Railtie < ::Rails::Engine
7
12
  config.before_initialize do
8
13
  if defined?(Sprockets::Engines)
9
14
  Sprockets::Engines
@@ -12,4 +17,4 @@ module StrawberryCough
12
17
  end
13
18
  end
14
19
  end
15
- end
20
+ end
@@ -14,7 +14,7 @@ module StrawberryCough
14
14
  def self.compile(route_set)
15
15
  functions = named_routes(route_set).inject(Set.new) do |memo, route|
16
16
  name = route.name.camelize(:lower) + "Path"
17
- memo << "#{name} : " + PathCompiler.compile(route.path)
17
+ memo << "#{name} : " + PathCompiler.compile(route.path.spec.to_s)
18
18
  end.to_a.join(',')
19
19
 
20
20
  <<-COMPILED
@@ -1,4 +1,4 @@
1
1
  module StrawberryCough
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
4
4
 
@@ -13,7 +13,11 @@ describe StrawberryCough::RoutesCompiler do
13
13
 
14
14
  it "makes a Routes JavaScript object when given an array of routes" do
15
15
  route = double('route')
16
- route.stub(:path) { "/parent/:id/edit(.:format)" }
16
+ path = Object.new
17
+ spec = "/parent/:id/edit(.:format)"
18
+ path.stub(:spec) { spec }
19
+ route.stub(:path) { path }
20
+
17
21
  route.stub(:name) { "edit_parent" }
18
22
  routes_object = compiler.compile([route])
19
23
  interpreter.eval(routes_object)
data/spec/spec_helper.rb CHANGED
@@ -4,6 +4,4 @@ $:.unshift lib_dir unless $:.include?(lib_dir)
4
4
  require 'rspec'
5
5
  require 'v8'
6
6
 
7
- require 'strawberry_cough'
8
-
9
- alias :context :describe
7
+ require 'strawberry_cough'
@@ -17,4 +17,4 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.files = `git ls-files`.split("\n")
19
19
  s.require_path = 'lib'
20
- end
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strawberry_cough
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -54,7 +54,7 @@ files:
54
54
  - lib/strawberry_cough.rb
55
55
  - lib/strawberry_cough/path_compiler.rb
56
56
  - lib/strawberry_cough/path_parser.rb
57
- - lib/strawberry_cough/rails/engine.rb
57
+ - lib/strawberry_cough/rails/railtie.rb
58
58
  - lib/strawberry_cough/routes_compiler.rb
59
59
  - lib/strawberry_cough/routes_js_template.rb
60
60
  - lib/strawberry_cough/version.rb