angular-rails 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -0
- data/lib/angular-rails/version.rb +1 -1
- data/lib/generators/angular/install/install_generator.rb +7 -2
- data/lib/generators/angular/resource_helpers.rb +9 -1
- data/test/dummy/log/test.log +1 -0
- data/test/dummy/tmp/cache/assets/D21/570/sprockets%2Fc943c801ce0caac77ad24200450912ae +0 -0
- data/test/generators/install_generator_test.rb +9 -2
- metadata +5 -5
data/README.md
CHANGED
@@ -33,6 +33,8 @@ Running `rails g angular:install` will create the following directory structure
|
|
33
33
|
services/
|
34
34
|
widgets/
|
35
35
|
|
36
|
+
It will also generate a `templates/` directory under app assets, where view templates can be stored. This lets you use haml, etc. for your angular views.
|
37
|
+
|
36
38
|
It will also add to the application.js file the appropriate requires.
|
37
39
|
|
38
40
|
## Generators
|
@@ -18,13 +18,18 @@ module Angular
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
21
|
+
def create_angular_javascript_dir_layout
|
22
22
|
%W{controllers filters services widgets}.each do |dir|
|
23
23
|
empty_directory "#{angular_path}/#{dir}"
|
24
24
|
create_file "#{angular_path}/#{dir}/.gitkeep" unless options[:skip_git]
|
25
25
|
end
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
|
+
def create_templates_dir_layout
|
29
|
+
empty_directory angular_templates_path
|
30
|
+
create_file "#{angular_templates_path}/.gitkeep" unless options[:skip_git]
|
31
|
+
end
|
32
|
+
|
28
33
|
def create_spec_dir_layout
|
29
34
|
empty_directory angular_spec_path
|
30
35
|
create_file "#{angular_spec_path}/.gitkeep" unless options[:skip_git]
|
@@ -9,8 +9,16 @@ module Angular
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
+
def assets_path
|
13
|
+
"app/assets"
|
14
|
+
end
|
15
|
+
|
12
16
|
def angular_path
|
13
|
-
"
|
17
|
+
"#{assets_path}/javascripts/angular"
|
18
|
+
end
|
19
|
+
|
20
|
+
def angular_templates_path
|
21
|
+
"#{assets_path}/templates"
|
14
22
|
end
|
15
23
|
|
16
24
|
def angular_spec_path
|
data/test/dummy/log/test.log
CHANGED
Binary file
|
@@ -14,7 +14,13 @@ class InstallGeneratorTest < Rails::Generators::TestCase
|
|
14
14
|
|
15
15
|
super
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
|
+
test "Assert template directory structure is created" do
|
19
|
+
run_generator
|
20
|
+
assert_directory angular_templates_path
|
21
|
+
assert_file "#{angular_templates_path}/.gitkeep"
|
22
|
+
end
|
23
|
+
|
18
24
|
test "Assert angular directory structure is created" do
|
19
25
|
run_generator
|
20
26
|
|
@@ -26,7 +32,7 @@ class InstallGeneratorTest < Rails::Generators::TestCase
|
|
26
32
|
|
27
33
|
test "Assert angular spec directory structure is created" do
|
28
34
|
run_generator
|
29
|
-
assert_directory
|
35
|
+
assert_directory angular_spec_path
|
30
36
|
assert_file "#{angular_spec_path}/.gitkeep"
|
31
37
|
end
|
32
38
|
|
@@ -38,6 +44,7 @@ class InstallGeneratorTest < Rails::Generators::TestCase
|
|
38
44
|
assert_no_file "#{angular_path}/#{dir}/.gitkeep"
|
39
45
|
end
|
40
46
|
assert_no_file "#{angular_spec_path}/.gitkeep"
|
47
|
+
assert_no_file "#{assets_path}/templates/.gitkeep"
|
41
48
|
end
|
42
49
|
|
43
50
|
test "Assert application.js require angular.js and angular directory" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angular-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-12-15 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &3077960 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *3077960
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: coffee-script
|
27
|
-
requirement: &
|
27
|
+
requirement: &3077710 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 2.2.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *3077710
|
36
36
|
description: Helpers for angularjs in a rails project (ripped from backbone-rails)
|
37
37
|
email:
|
38
38
|
- nate@ludicast.com
|