rails_best_practices 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.6
1
+ 0.3.7
@@ -1,7 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'ruby_parser'
3
3
  require 'erb'
4
- require 'haml'
5
4
  require 'yaml'
6
5
 
7
6
  module RailsBestPractices
@@ -27,10 +26,11 @@ module RailsBestPractices
27
26
  end
28
27
 
29
28
  def check(filename, content)
30
- if filename =~ /.*erb$/
29
+ if filename =~ /.*erb/
31
30
  content = ERB.new(content).src
32
31
  end
33
- if filename =~ /.*haml$/
32
+ if filename =~ /.*haml/
33
+ require 'haml'
34
34
  content = Haml::Engine.new(content).precompiled
35
35
  end
36
36
  node = parse(filename, content)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rails_best_practices}
8
- s.version = "0.3.6"
8
+ s.version = "0.3.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Richard Huang"]
12
- s.date = %q{2009-11-23}
12
+ s.date = %q{2009-11-25}
13
13
  s.default_executable = %q{rails_best_practices}
14
14
  s.description = %q{check rails files according to ihower's presentation 'rails best practices'}
15
15
  s.email = %q{flyerhzm@gmail.com}
@@ -88,27 +88,27 @@ Gem::Specification.new do |s|
88
88
  s.rubygems_version = %q{1.3.5}
89
89
  s.summary = %q{check rails files according to ihower's presentation 'rails best practices'}
90
90
  s.test_files = [
91
- "spec/rails_best_practices/checks/isolate_seed_data_check_spec.rb",
92
- "spec/rails_best_practices/checks/move_model_logic_into_model_check_spec.rb",
93
- "spec/rails_best_practices/checks/move_code_into_helper_check_spec.rb",
94
- "spec/rails_best_practices/checks/move_code_into_controller_check_spec.rb",
95
- "spec/rails_best_practices/checks/use_observer_check_spec.rb",
96
- "spec/rails_best_practices/checks/overuse_route_customizations_check_spec.rb",
97
- "spec/rails_best_practices/checks/nested_model_forms_check_spec.rb",
91
+ "spec/rails_best_practices/checks/add_model_virtual_attribute_check_spec.rb",
98
92
  "spec/rails_best_practices/checks/always_add_db_index_check_spec.rb",
99
- "spec/rails_best_practices/checks/many_to_many_collection_check_spec.rb",
100
- "spec/rails_best_practices/checks/use_before_filter_check_spec.rb",
93
+ "spec/rails_best_practices/checks/isolate_seed_data_check_spec.rb",
94
+ "spec/rails_best_practices/checks/keep_finders_on_their_own_model_check_spec.rb",
101
95
  "spec/rails_best_practices/checks/law_of_demeter_check_spec.rb",
102
- "spec/rails_best_practices/checks/use_scope_access_check_spec.rb",
103
- "spec/rails_best_practices/checks/replace_complex_creation_with_factory_method_check_spec.rb",
104
- "spec/rails_best_practices/checks/not_use_default_route_check_spec.rb",
96
+ "spec/rails_best_practices/checks/many_to_many_collection_check_spec.rb",
97
+ "spec/rails_best_practices/checks/move_code_into_controller_check_spec.rb",
98
+ "spec/rails_best_practices/checks/move_code_into_helper_check_spec.rb",
105
99
  "spec/rails_best_practices/checks/move_finder_to_named_scope_check_spec.rb",
106
- "spec/rails_best_practices/checks/use_model_callback_check_spec.rb",
107
- "spec/rails_best_practices/checks/add_model_virtual_attribute_check_spec.rb",
100
+ "spec/rails_best_practices/checks/move_model_logic_into_model_check_spec.rb",
101
+ "spec/rails_best_practices/checks/needless_deep_nesting_check_spec.rb",
102
+ "spec/rails_best_practices/checks/nested_model_forms_check_spec.rb",
103
+ "spec/rails_best_practices/checks/not_use_default_route_check_spec.rb",
104
+ "spec/rails_best_practices/checks/overuse_route_customizations_check_spec.rb",
105
+ "spec/rails_best_practices/checks/replace_complex_creation_with_factory_method_check_spec.rb",
108
106
  "spec/rails_best_practices/checks/replace_instance_variable_with_local_variable_check_spec.rb",
107
+ "spec/rails_best_practices/checks/use_before_filter_check_spec.rb",
109
108
  "spec/rails_best_practices/checks/use_model_association_check_spec.rb",
110
- "spec/rails_best_practices/checks/needless_deep_nesting_check_spec.rb",
111
- "spec/rails_best_practices/checks/keep_finders_on_their_own_model_check_spec.rb",
109
+ "spec/rails_best_practices/checks/use_model_callback_check_spec.rb",
110
+ "spec/rails_best_practices/checks/use_observer_check_spec.rb",
111
+ "spec/rails_best_practices/checks/use_scope_access_check_spec.rb",
112
112
  "spec/spec_helper.rb"
113
113
  ]
114
114
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_best_practices
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-23 00:00:00 +08:00
12
+ date: 2009-11-25 00:00:00 +08:00
13
13
  default_executable: rails_best_practices
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -133,25 +133,25 @@ signing_key:
133
133
  specification_version: 3
134
134
  summary: check rails files according to ihower's presentation 'rails best practices'
135
135
  test_files:
136
+ - spec/rails_best_practices/checks/add_model_virtual_attribute_check_spec.rb
137
+ - spec/rails_best_practices/checks/always_add_db_index_check_spec.rb
136
138
  - spec/rails_best_practices/checks/isolate_seed_data_check_spec.rb
137
- - spec/rails_best_practices/checks/move_model_logic_into_model_check_spec.rb
138
- - spec/rails_best_practices/checks/move_code_into_helper_check_spec.rb
139
+ - spec/rails_best_practices/checks/keep_finders_on_their_own_model_check_spec.rb
140
+ - spec/rails_best_practices/checks/law_of_demeter_check_spec.rb
141
+ - spec/rails_best_practices/checks/many_to_many_collection_check_spec.rb
139
142
  - spec/rails_best_practices/checks/move_code_into_controller_check_spec.rb
140
- - spec/rails_best_practices/checks/use_observer_check_spec.rb
141
- - spec/rails_best_practices/checks/overuse_route_customizations_check_spec.rb
143
+ - spec/rails_best_practices/checks/move_code_into_helper_check_spec.rb
144
+ - spec/rails_best_practices/checks/move_finder_to_named_scope_check_spec.rb
145
+ - spec/rails_best_practices/checks/move_model_logic_into_model_check_spec.rb
146
+ - spec/rails_best_practices/checks/needless_deep_nesting_check_spec.rb
142
147
  - spec/rails_best_practices/checks/nested_model_forms_check_spec.rb
143
- - spec/rails_best_practices/checks/always_add_db_index_check_spec.rb
144
- - spec/rails_best_practices/checks/many_to_many_collection_check_spec.rb
145
- - spec/rails_best_practices/checks/use_before_filter_check_spec.rb
146
- - spec/rails_best_practices/checks/law_of_demeter_check_spec.rb
147
- - spec/rails_best_practices/checks/use_scope_access_check_spec.rb
148
- - spec/rails_best_practices/checks/replace_complex_creation_with_factory_method_check_spec.rb
149
148
  - spec/rails_best_practices/checks/not_use_default_route_check_spec.rb
150
- - spec/rails_best_practices/checks/move_finder_to_named_scope_check_spec.rb
151
- - spec/rails_best_practices/checks/use_model_callback_check_spec.rb
152
- - spec/rails_best_practices/checks/add_model_virtual_attribute_check_spec.rb
149
+ - spec/rails_best_practices/checks/overuse_route_customizations_check_spec.rb
150
+ - spec/rails_best_practices/checks/replace_complex_creation_with_factory_method_check_spec.rb
153
151
  - spec/rails_best_practices/checks/replace_instance_variable_with_local_variable_check_spec.rb
152
+ - spec/rails_best_practices/checks/use_before_filter_check_spec.rb
154
153
  - spec/rails_best_practices/checks/use_model_association_check_spec.rb
155
- - spec/rails_best_practices/checks/needless_deep_nesting_check_spec.rb
156
- - spec/rails_best_practices/checks/keep_finders_on_their_own_model_check_spec.rb
154
+ - spec/rails_best_practices/checks/use_model_callback_check_spec.rb
155
+ - spec/rails_best_practices/checks/use_observer_check_spec.rb
156
+ - spec/rails_best_practices/checks/use_scope_access_check_spec.rb
157
157
  - spec/spec_helper.rb