strawberry_cough 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +2 -2
- data/Gemfile.lock +38 -38
- data/README.md +4 -0
- data/lib/strawberry_cough.rb +2 -2
- data/lib/strawberry_cough/rails/{engine.rb → railtie.rb} +8 -3
- data/lib/strawberry_cough/routes_compiler.rb +1 -1
- data/lib/strawberry_cough/version.rb +1 -1
- data/spec/routes_compiler_spec.rb +5 -1
- data/spec/spec_helper.rb +1 -3
- data/strawberry_cough.gemspec +1 -1
- metadata +2 -2
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -6,74 +6,74 @@ PATH
|
|
6
6
|
GEM
|
7
7
|
remote: http://rubygems.org/
|
8
8
|
specs:
|
9
|
-
actionpack (3.
|
10
|
-
activemodel (= 3.
|
11
|
-
activesupport (= 3.
|
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
|
-
|
15
|
-
rack (~> 1.
|
16
|
-
rack-cache (~> 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.
|
20
|
-
activemodel (3.
|
21
|
-
activesupport (= 3.
|
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.
|
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.
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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.
|
39
|
+
rack-test (0.6.2)
|
41
40
|
rack (>= 1.0)
|
42
|
-
railties (3.
|
43
|
-
actionpack (= 3.
|
44
|
-
activesupport (= 3.
|
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 (
|
47
|
+
thor (>= 0.14.6, < 2.0)
|
49
48
|
rake (0.9.2.2)
|
50
|
-
rdoc (3.
|
49
|
+
rdoc (3.12)
|
51
50
|
json (~> 1.4)
|
52
|
-
rspec (2.
|
53
|
-
rspec-core (~> 2.
|
54
|
-
rspec-expectations (~> 2.
|
55
|
-
rspec-mocks (~> 2.
|
56
|
-
rspec-core (2.
|
57
|
-
rspec-expectations (2.
|
58
|
-
diff-lcs (~> 1.1.
|
59
|
-
rspec-mocks (2.
|
60
|
-
sprockets (2.
|
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.
|
67
|
-
|
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.
|
74
|
+
activesupport (~> 3.2)
|
75
75
|
bundler (>= 1.0.0)
|
76
|
-
railties (~> 3.
|
76
|
+
railties (~> 3.2)
|
77
77
|
rake
|
78
78
|
rspec
|
79
79
|
sprockets-rails
|
data/README.md
CHANGED
data/lib/strawberry_cough.rb
CHANGED
@@ -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/
|
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 '
|
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
|
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
|
@@ -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
|
-
|
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
data/strawberry_cough.gemspec
CHANGED
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.
|
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/
|
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
|