object_dojo 0.0.1 → 0.0.2
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.lock +1 -1
- data/README.markdown +11 -6
- data/config/rules.yml +1 -1
- data/lib/object_dojo/version.rb +1 -1
- data/lib/rules/method_indentation.rb +3 -3
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
@@ -6,19 +6,25 @@ ObjectDojo is a utility to improve your Object oriented programming skills using
|
|
6
6
|
|
7
7
|
1. One level of indentation per method
|
8
8
|
2. Don’t use the ELSE keyword
|
9
|
-
3. Wrap all primitives and Strings
|
9
|
+
3. Wrap all primitives and Strings(Not implemented)
|
10
10
|
4. First class collections
|
11
11
|
5. One dot per line
|
12
|
-
6. Don’t abbreviate
|
12
|
+
6. Don’t abbreviate (Not implemented)
|
13
13
|
7. Keep all entities small
|
14
14
|
8. No classes with more than two instance variables
|
15
15
|
9. No getters/setters/properties
|
16
16
|
|
17
|
+
### Installation
|
18
|
+
|
19
|
+
To install object dojo
|
20
|
+
|
21
|
+
$ gem install object_dojo
|
22
|
+
|
17
23
|
### Usage
|
18
24
|
|
19
|
-
Run the command line utility dojo
|
25
|
+
Run the command line utility dojo with path to code
|
20
26
|
|
21
|
-
|
27
|
+
$ dojo /path/to/code
|
22
28
|
|
23
29
|
### Configure
|
24
30
|
|
@@ -28,5 +34,4 @@ $ dojo -h
|
|
28
34
|
|
29
35
|
#### Supported languages
|
30
36
|
|
31
|
-
The current version supports only Ruby.
|
32
|
-
Support for other languages like Java, C# and Python will be added in the future.
|
37
|
+
The current version supports only Ruby.
|
data/config/rules.yml
CHANGED
data/lib/object_dojo/version.rb
CHANGED
@@ -2,15 +2,15 @@ class MethodIndentation
|
|
2
2
|
TABS = 2
|
3
3
|
|
4
4
|
def initialize(max)
|
5
|
-
@max = max
|
5
|
+
@max = max
|
6
6
|
end
|
7
7
|
|
8
8
|
def valid?(method)
|
9
|
-
max_indent(method) <= @max
|
9
|
+
max_indent(method) <= @max + 2 # including class and def indent
|
10
10
|
end
|
11
11
|
|
12
12
|
def message
|
13
|
-
"indentation is more than #{@max}
|
13
|
+
"indentation is more than #{@max} level"
|
14
14
|
end
|
15
15
|
|
16
16
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: object_dojo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -65,7 +65,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
65
|
version: '0'
|
66
66
|
segments:
|
67
67
|
- 0
|
68
|
-
hash: -
|
68
|
+
hash: -1036084530137473874
|
69
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
70
|
none: false
|
71
71
|
requirements:
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
segments:
|
76
76
|
- 0
|
77
|
-
hash: -
|
77
|
+
hash: -1036084530137473874
|
78
78
|
requirements: []
|
79
79
|
rubyforge_project: object_dojo
|
80
80
|
rubygems_version: 1.8.10
|