angular-rails 0.0.8 → 0.0.9

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/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
@@ -1,3 +1,3 @@
1
1
  module AngularRails
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -18,13 +18,18 @@ module Angular
18
18
  end
19
19
  end
20
20
 
21
- def create_dir_layout
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
- "app/assets/javascripts/angular"
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
@@ -8,3 +8,4 @@ Compiled angular.min (2ms) (pid 46699)
8
8
  Compiled angular-helpers (589ms) (pid 50164)
9
9
  Compiled angular.min (7ms) (pid 50164)
10
10
  Compiled angular-helpers (184ms) (pid 56225)
11
+ Compiled angular-helpers (522ms) (pid 4909)
@@ -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 "#{angular_spec_path}"
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.8
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: &3064950 !ruby/object:Gem::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: *3064950
24
+ version_requirements: *3077960
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: coffee-script
27
- requirement: &3064700 !ruby/object:Gem::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: *3064700
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