formatted_length 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -1
- data/lib/formatted_length/version.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +33 -0
- data/test/dummy/log/test.log +2 -0
- metadata +17 -9
data/README.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
|
-
# FormattedLength
|
1
|
+
# FormattedLength [![Build Status](https://secure.travis-ci.org/mrnbrkt/formatted_length.png)](http://travis-ci.org/mrnbrkt/formatted_length)
|
2
|
+
|
2
3
|
|
3
4
|
## Description
|
4
5
|
Gem allows auto-formatting to/from string to time span (integer value of seconds).
|
5
6
|
It does so by adding an *acts_as_formatted_length* method to ActiveRecord base classes.
|
6
7
|
|
8
|
+
## Installation
|
9
|
+
Simply add this row to your Gemfile
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'formatted_length'
|
13
|
+
```
|
7
14
|
|
8
15
|
## Usage
|
9
16
|
Once *acts_as_formatted_length* is added to class definition, a _formatted_length_ property becomes available,
|
Binary file
|
Binary file
|
@@ -0,0 +1,33 @@
|
|
1
|
+
[1m[36m (0.1ms)[0m [1mselect sqlite_version(*)[0m
|
2
|
+
[1m[35m (2.3ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
3
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
4
|
+
[1m[35m (1.0ms)[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
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
7
|
+
Migrating to CreateModelWithDefaultLengthFields (20111026123348)
|
8
|
+
[1m[35m (0.0ms)[0m select sqlite_version(*)
|
9
|
+
[1m[36m (0.4ms)[0m [1mCREATE TABLE "model_with_default_length_fields" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "length" integer, "created_at" datetime, "updated_at" datetime) [0m
|
10
|
+
[1m[35m (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20111026123348')
|
11
|
+
Migrating to CreateModelWithNonDefaultLengthFields (20111026123424)
|
12
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "model_with_non_default_length_fields" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "foo" integer, "created_at" datetime, "updated_at" datetime) [0m
|
13
|
+
[1m[35m (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20111026123424')
|
14
|
+
Migrating to CreateModelWithLengthFieldAndSetters (20111026144756)
|
15
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "model_with_length_field_and_setters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "length" integer, "created_at" datetime, "updated_at" datetime) [0m
|
16
|
+
[1m[35m (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20111026144756')
|
17
|
+
[1m[36m (0.2ms)[0m [1mselect sqlite_version(*)[0m
|
18
|
+
[1m[35m (0.1ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
19
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("model_with_default_length_fields")[0m
|
20
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("model_with_length_field_and_setters")
|
21
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("model_with_non_default_length_fields")[0m
|
22
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
23
|
+
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
24
|
+
[1m[36m (1.3ms)[0m [1mCREATE TABLE "model_with_default_length_fields" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "length" integer, "created_at" datetime, "updated_at" datetime) [0m
|
25
|
+
[1m[35m (1.1ms)[0m CREATE TABLE "model_with_length_field_and_setters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "length" integer, "created_at" datetime, "updated_at" datetime)
|
26
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "model_with_non_default_length_fields" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "foo" integer, "created_at" datetime, "updated_at" datetime) [0m
|
27
|
+
[1m[35m (1.1ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
28
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
29
|
+
[1m[35m (1.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
30
|
+
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
31
|
+
[1m[35m (1.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20111026144756')
|
32
|
+
[1m[36m (0.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20111026123348')[0m
|
33
|
+
[1m[35m (1.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20111026123424')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formatted_length
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01
|
12
|
+
date: 2012-02-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70239312327800 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70239312327800
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sqlite3
|
27
|
-
requirement: &
|
27
|
+
requirement: &70239312326880 !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: *70239312326880
|
36
36
|
description: Adds formatted_length function to classes that acts_like_formatted_length,
|
37
37
|
converting a length represented in seconds to a string
|
38
38
|
email:
|
@@ -73,10 +73,14 @@ files:
|
|
73
73
|
- test/dummy/config/locales/en.yml
|
74
74
|
- test/dummy/config/routes.rb
|
75
75
|
- test/dummy/config.ru
|
76
|
+
- test/dummy/db/development.sqlite3
|
76
77
|
- test/dummy/db/migrate/20111026123348_create_model_with_default_length_fields.rb
|
77
78
|
- test/dummy/db/migrate/20111026123424_create_model_with_non_default_length_fields.rb
|
78
79
|
- test/dummy/db/migrate/20111026144756_create_model_with_length_field_and_setters.rb
|
79
80
|
- test/dummy/db/schema.rb
|
81
|
+
- test/dummy/db/test.sqlite3
|
82
|
+
- test/dummy/log/development.log
|
83
|
+
- test/dummy/log/test.log
|
80
84
|
- test/dummy/public/404.html
|
81
85
|
- test/dummy/public/422.html
|
82
86
|
- test/dummy/public/500.html
|
@@ -105,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
109
|
version: '0'
|
106
110
|
segments:
|
107
111
|
- 0
|
108
|
-
hash:
|
112
|
+
hash: 256112071020433159
|
109
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
114
|
none: false
|
111
115
|
requirements:
|
@@ -114,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
118
|
version: '0'
|
115
119
|
segments:
|
116
120
|
- 0
|
117
|
-
hash:
|
121
|
+
hash: 256112071020433159
|
118
122
|
requirements: []
|
119
123
|
rubyforge_project:
|
120
124
|
rubygems_version: 1.8.10
|
@@ -147,10 +151,14 @@ test_files:
|
|
147
151
|
- test/dummy/config/locales/en.yml
|
148
152
|
- test/dummy/config/routes.rb
|
149
153
|
- test/dummy/config.ru
|
154
|
+
- test/dummy/db/development.sqlite3
|
150
155
|
- test/dummy/db/migrate/20111026123348_create_model_with_default_length_fields.rb
|
151
156
|
- test/dummy/db/migrate/20111026123424_create_model_with_non_default_length_fields.rb
|
152
157
|
- test/dummy/db/migrate/20111026144756_create_model_with_length_field_and_setters.rb
|
153
158
|
- test/dummy/db/schema.rb
|
159
|
+
- test/dummy/db/test.sqlite3
|
160
|
+
- test/dummy/log/development.log
|
161
|
+
- test/dummy/log/test.log
|
154
162
|
- test/dummy/public/404.html
|
155
163
|
- test/dummy/public/422.html
|
156
164
|
- test/dummy/public/500.html
|