simple_model 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -0
- data/Gemfile.lock +5 -5
- data/lib/simple_model/extend_core.rb +6 -0
- data/lib/simple_model/version.rb +1 -1
- data/spec/attributes_spec.rb +1 -1
- data/spec/spec_helper.rb +4 -3
- metadata +44 -52
- data/.autotest +0 -10
- data/spec/spec.opts +0 -4
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile.lock
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
simple_model (0.2.
|
4
|
+
simple_model (0.2.6)
|
5
5
|
activemodel (~> 3.0.5)
|
6
6
|
activesupport (~> 3.0.5)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (3.0.
|
12
|
-
activesupport (= 3.0.
|
11
|
+
activemodel (3.0.10)
|
12
|
+
activesupport (= 3.0.10)
|
13
13
|
builder (~> 2.1.2)
|
14
14
|
i18n (~> 0.5.0)
|
15
|
-
activesupport (3.0.
|
15
|
+
activesupport (3.0.10)
|
16
16
|
builder (2.1.2)
|
17
|
-
diff-lcs (1.1.
|
17
|
+
diff-lcs (1.1.3)
|
18
18
|
i18n (0.5.0)
|
19
19
|
rspec (2.6.0)
|
20
20
|
rspec-core (~> 2.6.0)
|
@@ -28,7 +28,9 @@ module SimpleModel
|
|
28
28
|
|
29
29
|
# Returns a string with representation of currency, rounded to nearest hundredth
|
30
30
|
def to_currency_s(symbol="$")
|
31
|
+
|
31
32
|
num = self.round_to(2).to_s
|
33
|
+
neg = num.include?("-")
|
32
34
|
while num.index('.') != (num.length-3)
|
33
35
|
num << '0'
|
34
36
|
end
|
@@ -38,6 +40,10 @@ module SimpleModel
|
|
38
40
|
comma += 4
|
39
41
|
end
|
40
42
|
num.insert(0,symbol)
|
43
|
+
if neg
|
44
|
+
num.delete!("-")
|
45
|
+
num.insert(0, "-")
|
46
|
+
end
|
41
47
|
num
|
42
48
|
end
|
43
49
|
end
|
data/lib/simple_model/version.rb
CHANGED
data/spec/attributes_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
#$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
#$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
3
|
require 'simple_model'
|
4
4
|
require 'rspec'
|
5
|
+
require 'bundler/setup'
|
5
6
|
|
6
7
|
|
7
8
|
|
8
9
|
# Requires supporting files with custom matchers and macros, etc,
|
9
10
|
# in ./support/ and its subdirectories.
|
10
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
11
|
+
#Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
11
12
|
|
12
13
|
|
13
14
|
RSpec.configure do |config|
|
metadata
CHANGED
@@ -1,62 +1,59 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_model
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.6
|
4
5
|
prerelease:
|
5
|
-
version: 0.2.5
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Joshua T Mckinney
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-09-15 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: activesupport
|
17
|
-
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70363326271940 !ruby/object:Gem::Requirement
|
19
17
|
none: false
|
20
|
-
requirements:
|
18
|
+
requirements:
|
21
19
|
- - ~>
|
22
|
-
- !ruby/object:Gem::Version
|
20
|
+
- !ruby/object:Gem::Version
|
23
21
|
version: 3.0.5
|
24
22
|
type: :runtime
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: activemodel
|
28
23
|
prerelease: false
|
29
|
-
|
24
|
+
version_requirements: *70363326271940
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activemodel
|
27
|
+
requirement: &70363326271380 !ruby/object:Gem::Requirement
|
30
28
|
none: false
|
31
|
-
requirements:
|
29
|
+
requirements:
|
32
30
|
- - ~>
|
33
|
-
- !ruby/object:Gem::Version
|
31
|
+
- !ruby/object:Gem::Version
|
34
32
|
version: 3.0.5
|
35
33
|
type: :runtime
|
36
|
-
version_requirements: *id002
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rspec
|
39
34
|
prerelease: false
|
40
|
-
|
35
|
+
version_requirements: *70363326271380
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec
|
38
|
+
requirement: &70363326270960 !ruby/object:Gem::Requirement
|
41
39
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version:
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
46
44
|
type: :development
|
47
|
-
|
48
|
-
|
49
|
-
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70363326270960
|
47
|
+
description: Simpifies building tableless models or models backed by webservices.
|
48
|
+
Create data type specific attributes with default if values.
|
49
|
+
email:
|
50
50
|
- joshmckin@gmail.com
|
51
51
|
executables: []
|
52
|
-
|
53
52
|
extensions: []
|
54
|
-
|
55
53
|
extra_rdoc_files: []
|
56
|
-
|
57
|
-
files:
|
58
|
-
- .autotest
|
54
|
+
files:
|
59
55
|
- .gitignore
|
56
|
+
- .rspec
|
60
57
|
- Gemfile
|
61
58
|
- Gemfile.lock
|
62
59
|
- LICENSE.txt
|
@@ -74,38 +71,33 @@ files:
|
|
74
71
|
- spec/attributes_spec.rb
|
75
72
|
- spec/extend_core_spec.rb
|
76
73
|
- spec/simple_model_spec.rb
|
77
|
-
- spec/spec.opts
|
78
74
|
- spec/spec_helper.rb
|
79
|
-
homepage:
|
75
|
+
homepage: ''
|
80
76
|
licenses: []
|
81
|
-
|
82
77
|
post_install_message:
|
83
78
|
rdoc_options: []
|
84
|
-
|
85
|
-
require_paths:
|
79
|
+
require_paths:
|
86
80
|
- lib
|
87
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
82
|
none: false
|
89
|
-
requirements:
|
90
|
-
- -
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version:
|
93
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
88
|
none: false
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
version:
|
89
|
+
requirements:
|
90
|
+
- - ! '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
99
93
|
requirements: []
|
100
|
-
|
101
94
|
rubyforge_project: simple_model
|
102
95
|
rubygems_version: 1.8.6
|
103
96
|
signing_key:
|
104
97
|
specification_version: 3
|
105
98
|
summary: Simpifies building tableless models or models backed by webservices
|
106
|
-
test_files:
|
99
|
+
test_files:
|
107
100
|
- spec/attributes_spec.rb
|
108
101
|
- spec/extend_core_spec.rb
|
109
102
|
- spec/simple_model_spec.rb
|
110
|
-
- spec/spec.opts
|
111
103
|
- spec/spec_helper.rb
|
data/.autotest
DELETED
data/spec/spec.opts
DELETED