I18nFloat 1.0.0 → 1.0.1
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 +1 -1
- data/lib/I18nFloat/version.rb +1 -1
- data/test/I18nFloat_test.rb +1 -15
- data/test/dummy/test/unit/marathon_test.rb +15 -3
- metadata +17 -13
- data/test/dummy/log/development.log +0 -83
data/README.md
CHANGED
@@ -4,7 +4,7 @@ I18nFloat
|
|
4
4
|
Description
|
5
5
|
-----------
|
6
6
|
|
7
|
-
[Ruby](http://www.ruby-lang.org) gem to use with [Rails](http://www.rubyonrails.org). I18nFloat allows your users to use format number like "1 200,84" in forms.
|
7
|
+
[Ruby](http://www.ruby-lang.org) gem to use with [Rails](http://www.rubyonrails.org). I18nFloat allows your users to use format number like "1 200,84" in forms. ActiveRecord Float attributes don't care anymore if you like commas or dots!
|
8
8
|
|
9
9
|
Features:
|
10
10
|
|
data/lib/I18nFloat/version.rb
CHANGED
data/test/I18nFloat_test.rb
CHANGED
@@ -1,19 +1,5 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class I18nFloatTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
assert_equal 1200.00, Marathon.new(:duration => "1200").duration
|
6
|
-
end
|
7
|
-
|
8
|
-
test "1200.00" do
|
9
|
-
assert_equal 1200.00, Marathon.new(:duration => "1200.00").duration
|
10
|
-
end
|
11
|
-
|
12
|
-
test "1200,00" do
|
13
|
-
assert_equal 1200.00, Marathon.new(:duration => "1200,00").duration
|
14
|
-
end
|
15
|
-
|
16
|
-
test "1 200,00" do
|
17
|
-
assert_equal 1200.00, Marathon.new(:duration => "1 200,00").duration
|
18
|
-
end
|
4
|
+
|
19
5
|
end
|
@@ -1,7 +1,19 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class MarathonTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
test "1200" do
|
5
|
+
assert_equal 1200.00, Marathon.new(:duration => "1200").duration
|
6
|
+
end
|
7
|
+
|
8
|
+
test "1200.00" do
|
9
|
+
assert_equal 1200.00, Marathon.new(:duration => "1200.00").duration
|
10
|
+
end
|
11
|
+
|
12
|
+
test "1200,00" do
|
13
|
+
assert_equal 1200.00, Marathon.new(:duration => "1200,00").duration
|
14
|
+
end
|
15
|
+
|
16
|
+
test "1 200,00" do
|
17
|
+
assert_equal 1200.00, Marathon.new(:duration => "1 200,00").duration
|
18
|
+
end
|
7
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: I18nFloat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-09-
|
12
|
+
date: 2011-09-17 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &2152144840 !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: *
|
24
|
+
version_requirements: *2152144840
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sqlite3
|
27
|
-
requirement: &
|
27
|
+
requirement: &2152143800 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2152143800
|
36
36
|
description: ! "Allow french like format for ActiveModel Float / Decimal attributes.\n\n
|
37
37
|
\ User inputs like \"1 200,54\" will be nicely saved as 1200.54 in your database.\n\n
|
38
38
|
\ Standard format is still usable."
|
@@ -48,8 +48,6 @@ files:
|
|
48
48
|
- MIT-LICENSE
|
49
49
|
- Rakefile
|
50
50
|
- README.md
|
51
|
-
- test/I18nFloat_test.rb
|
52
|
-
- test/dummy/Rakefile
|
53
51
|
- test/dummy/app/assets/javascripts/application.js
|
54
52
|
- test/dummy/app/assets/stylesheets/application.css
|
55
53
|
- test/dummy/app/controllers/application_controller.rb
|
@@ -76,15 +74,16 @@ files:
|
|
76
74
|
- test/dummy/db/migrate/20110915220323_create_marathons.rb
|
77
75
|
- test/dummy/db/schema.rb
|
78
76
|
- test/dummy/db/test.sqlite3
|
79
|
-
- test/dummy/log/development.log
|
80
77
|
- test/dummy/log/test.log
|
81
78
|
- test/dummy/public/404.html
|
82
79
|
- test/dummy/public/422.html
|
83
80
|
- test/dummy/public/500.html
|
84
81
|
- test/dummy/public/favicon.ico
|
82
|
+
- test/dummy/Rakefile
|
85
83
|
- test/dummy/script/rails
|
86
84
|
- test/dummy/test/fixtures/marathons.yml
|
87
85
|
- test/dummy/test/unit/marathon_test.rb
|
86
|
+
- test/I18nFloat_test.rb
|
88
87
|
- test/test_helper.rb
|
89
88
|
homepage: https://bitbucket.org/Bounga/i18nfloat
|
90
89
|
licenses: []
|
@@ -98,21 +97,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
97
|
- - ! '>='
|
99
98
|
- !ruby/object:Gem::Version
|
100
99
|
version: '0'
|
100
|
+
segments:
|
101
|
+
- 0
|
102
|
+
hash: 731414261953546997
|
101
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
104
|
none: false
|
103
105
|
requirements:
|
104
106
|
- - ! '>='
|
105
107
|
- !ruby/object:Gem::Version
|
106
108
|
version: '0'
|
109
|
+
segments:
|
110
|
+
- 0
|
111
|
+
hash: 731414261953546997
|
107
112
|
requirements: []
|
108
113
|
rubyforge_project:
|
109
|
-
rubygems_version: 1.8.
|
114
|
+
rubygems_version: 1.8.6
|
110
115
|
signing_key:
|
111
116
|
specification_version: 3
|
112
117
|
summary: Allow french float format in ActiveModel attributes
|
113
118
|
test_files:
|
114
|
-
- test/I18nFloat_test.rb
|
115
|
-
- test/dummy/Rakefile
|
116
119
|
- test/dummy/app/assets/javascripts/application.js
|
117
120
|
- test/dummy/app/assets/stylesheets/application.css
|
118
121
|
- test/dummy/app/controllers/application_controller.rb
|
@@ -139,13 +142,14 @@ test_files:
|
|
139
142
|
- test/dummy/db/migrate/20110915220323_create_marathons.rb
|
140
143
|
- test/dummy/db/schema.rb
|
141
144
|
- test/dummy/db/test.sqlite3
|
142
|
-
- test/dummy/log/development.log
|
143
145
|
- test/dummy/log/test.log
|
144
146
|
- test/dummy/public/404.html
|
145
147
|
- test/dummy/public/422.html
|
146
148
|
- test/dummy/public/500.html
|
147
149
|
- test/dummy/public/favicon.ico
|
150
|
+
- test/dummy/Rakefile
|
148
151
|
- test/dummy/script/rails
|
149
152
|
- test/dummy/test/fixtures/marathons.yml
|
150
153
|
- test/dummy/test/unit/marathon_test.rb
|
154
|
+
- test/I18nFloat_test.rb
|
151
155
|
- test/test_helper.rb
|
@@ -1,83 +0,0 @@
|
|
1
|
-
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
2
|
-
[1m[35m (12.6ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
3
|
-
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
4
|
-
[1m[35m (2.2ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
5
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
6
|
-
Migrating to CreateMarathons (20110915220323)
|
7
|
-
[1m[35m (0.6ms)[0m CREATE TABLE "marathons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "duration" float, "created_at" datetime, "updated_at" datetime)
|
8
|
-
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20110915220323')[0m
|
9
|
-
[1m[35m (0.3ms)[0m select sqlite_version(*)
|
10
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
11
|
-
[1m[35m (0.0ms)[0m PRAGMA index_list("marathons")
|
12
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
13
|
-
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
14
|
-
[1m[36m (12.8ms)[0m [1mCREATE TABLE "marathons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "duration" float, "created_at" datetime, "updated_at" datetime) [0m
|
15
|
-
[1m[35m (1.8ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
16
|
-
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
17
|
-
[1m[35m (2.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
18
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
19
|
-
[1m[35m (1.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20110915220323')
|
20
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
21
|
-
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
22
|
-
[1m[36m (12.5ms)[0m [1mCREATE TABLE "marathons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "duration" float, "created_at" datetime, "updated_at" datetime) [0m
|
23
|
-
[1m[35m (1.6ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
24
|
-
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
25
|
-
[1m[35m (1.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
26
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
27
|
-
[1m[35m (1.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20110915220323')
|
28
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
29
|
-
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
30
|
-
[1m[36m (12.7ms)[0m [1mCREATE TABLE "marathons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "duration" float, "created_at" datetime, "updated_at" datetime) [0m
|
31
|
-
[1m[35m (1.9ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
32
|
-
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
33
|
-
[1m[35m (2.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
34
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
35
|
-
[1m[35m (1.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20110915220323')
|
36
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
37
|
-
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
38
|
-
[1m[36m (12.6ms)[0m [1mCREATE TABLE "marathons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "duration" float, "created_at" datetime, "updated_at" datetime) [0m
|
39
|
-
[1m[35m (1.8ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
40
|
-
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
41
|
-
[1m[35m (1.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
42
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
43
|
-
[1m[35m (1.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20110915220323')
|
44
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
45
|
-
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
46
|
-
[1m[36m (12.8ms)[0m [1mCREATE TABLE "marathons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "duration" float, "created_at" datetime, "updated_at" datetime) [0m
|
47
|
-
[1m[35m (1.9ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
48
|
-
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
49
|
-
[1m[35m (1.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
50
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
51
|
-
[1m[35m (1.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20110915220323')
|
52
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
53
|
-
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
54
|
-
[1m[36m (12.5ms)[0m [1mCREATE TABLE "marathons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "duration" float, "created_at" datetime, "updated_at" datetime) [0m
|
55
|
-
[1m[35m (1.6ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
56
|
-
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
57
|
-
[1m[35m (1.7ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
58
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
59
|
-
[1m[35m (1.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20110915220323')
|
60
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
61
|
-
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
62
|
-
[1m[36m (1.9ms)[0m [1mCREATE TABLE "marathons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "duration" float, "created_at" datetime, "updated_at" datetime) [0m
|
63
|
-
[1m[35m (1.6ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
64
|
-
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
65
|
-
[1m[35m (1.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
66
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
67
|
-
[1m[35m (2.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20110915220323')
|
68
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
69
|
-
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
70
|
-
[1m[36m (12.6ms)[0m [1mCREATE TABLE "marathons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "duration" float, "created_at" datetime, "updated_at" datetime) [0m
|
71
|
-
[1m[35m (1.8ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
72
|
-
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
73
|
-
[1m[35m (1.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
74
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
75
|
-
[1m[35m (1.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20110915220323')
|
76
|
-
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
77
|
-
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
78
|
-
[1m[36m (12.8ms)[0m [1mCREATE TABLE "marathons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "duration" float, "created_at" datetime, "updated_at" datetime) [0m
|
79
|
-
[1m[35m (1.9ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
80
|
-
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
81
|
-
[1m[35m (1.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
82
|
-
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
83
|
-
[1m[35m (1.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20110915220323')
|