arbitrium 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/arbitrium/file_creator.rb +7 -3
- data/lib/arbitrium/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2efbfac932311db8e460314e5639ae8963e078c
|
4
|
+
data.tar.gz: c911ec4c7753eb79cdc9f034f380f0af39decc60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91a752564c95ed12e83491ce9aa52768ca9025a6882cc724108fe48c696946e092039e559fafcbff6200243533eaa7f051159dcc6214876dc4c0c8bd1b00ec57
|
7
|
+
data.tar.gz: 56a4bc60e282a9da760152072ba4941731553fa52ec90cff831f11d585a45da06896a1a2e46f8efb544f8a8315c6a14bf6fd4630795aa3ddd2705738869f84bf
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ Any deviation from data types will result in an error being raised.
|
|
46
46
|
|
47
47
|
What a successful result may look like:
|
48
48
|
```
|
49
|
-
result = Arbitrium::Result.new(user.save,
|
49
|
+
result = Arbitrium::Result.new(user.save, 'Some yucky error', user)
|
50
50
|
|
51
51
|
result.successful? # true
|
52
52
|
result.failed? # false
|
@@ -23,7 +23,7 @@ module Arbitrium
|
|
23
23
|
File.open(full_path_with_file, 'w') do |file|
|
24
24
|
file.write(<<~EOF
|
25
25
|
require 'arbitrium'
|
26
|
-
|
26
|
+
|
27
27
|
#{file_header}
|
28
28
|
#{add_spaces} def self.#{method_name}()
|
29
29
|
#{add_spaces} new().#{method_name}
|
@@ -67,13 +67,17 @@ module Arbitrium
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def class_header
|
70
|
-
module_array.empty? ? "class #{class_name}" : "\n#{add_spaces(module_array.length)}
|
70
|
+
module_array.empty? ? "class #{class_name}" : "\n#{add_spaces(module_array.length)} class #{class_name}"
|
71
71
|
end
|
72
72
|
|
73
|
-
def add_spaces(value =
|
73
|
+
def add_spaces(value = modified_module_length)
|
74
74
|
' ' * value
|
75
75
|
end
|
76
76
|
|
77
|
+
def modified_module_length
|
78
|
+
module_array.empty? ? 0 : module_array.length + 1
|
79
|
+
end
|
80
|
+
|
77
81
|
def class_name
|
78
82
|
class_portion_of_path.split('_').map(&:capitalize).join('')
|
79
83
|
end
|
data/lib/arbitrium/version.rb
CHANGED