activerecord-time 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1430418d53117b880e0f6f9ee19f76f11c79cfe
4
- data.tar.gz: 738201de8e6cd4ca6e3c4b11213867df2cd9c91d
3
+ metadata.gz: 58d80c32a813a511615958ac7e50c39646a6f6bf
4
+ data.tar.gz: 57f8670274cdf265cd4ffa812046a8142e04bda2
5
5
  SHA512:
6
- metadata.gz: 8993938930022bbfbe9bc2fb388fafe090bd91113e7b7d34abe090c6419e1cdbc3db0264833701e291bd4ff32cec953653bfef8009fcdafb2c8d8d702ecf4a02
7
- data.tar.gz: 887959d0d52c63ebc6d77500482dd9abc343892ea8ef57969a66cbc76e00b7bb89e92b63c4b4fff8197d066b1787a989e2bdd8c6b990830ab44374528e5770fe
6
+ metadata.gz: 403db3b2198fe2bb9042ca4087109882dc8445e29fdadbc3ae150f72ded6715dbad0e5ee52307e88d7e9c1560ff97d601d8c3c6e4abf71087ceb7da0369fe086
7
+ data.tar.gz: 4612616c3dba28dd200b6994fb3d1763d0470f01cd71f64fac68b20c36c06ed1f2fa4763baef7f7eba0b56105ce21d2f774db52c0bf330656179095267f2cce4
@@ -3,13 +3,17 @@ sudo: false
3
3
  rvm:
4
4
  - jruby-head
5
5
  - ruby-head
6
+ - jruby-9.0.0.0
6
7
  - "2.2"
7
- - jruby-19mode
8
8
  - "2.1"
9
9
  - "2.0.0"
10
- - "1.9.3"
10
+ - jruby-19mode
11
+ gemfile:
12
+ - gemfiles/ar42.gemfile
13
+ - gemfiles/ar41.gemfile
14
+ - gemfiles/ar40.gemfile
15
+ - gemfiles/ar32.gemfile
11
16
  env:
12
- - AR_VERSION="~>4.2.1"
13
- - AR_VERSION="~>4.1.10"
14
- - AR_VERSION="~>4.0.13"
15
- - AR_VERSION="~>3.2.21"
17
+ - ADAPTER="postgresql"
18
+ - ADAPTER="derby"
19
+ - ADAPTER="sqlite3"
data/Gemfile CHANGED
@@ -9,6 +9,6 @@ end
9
9
 
10
10
  # TODO(uwe): Remove when ARJDBC 1.4.0 is out
11
11
  if RUBY_ENGINE == 'jruby'
12
- gem 'activerecord-jdbc-adapter', '>= 1.4.0.dev', github: 'jruby/activerecord-jdbc-adapter'
12
+ gem 'activerecord-jdbc-adapter', '>= 1.3.17', github: 'jruby/activerecord-jdbc-adapter', branch: '1-3-stable'
13
13
  end
14
14
  # ODOT
data/README.md CHANGED
@@ -41,7 +41,7 @@ or
41
41
  ```Ruby
42
42
  create_table :schedules do |table|
43
43
  ...
44
- t.time :start_at
44
+ t.column :start_at, :time
45
45
  ...
46
46
  end
47
47
  ```
@@ -0,0 +1,3 @@
1
+ eval File.read("#{File.dirname __FILE__}/common.gemfile")
2
+
3
+ gem 'activerecord', '~>3.2.22'
@@ -0,0 +1,63 @@
1
+ GIT
2
+ remote: git://github.com/jruby/activerecord-jdbc-adapter.git
3
+ revision: 16446e752f07e03eaa6386184039addb42fc3e60
4
+ branch: 1-3-stable
5
+ specs:
6
+ activerecord-jdbc-adapter (1.3.17)
7
+ activerecord (>= 2.2)
8
+ activerecord-jdbcpostgresql-adapter (1.3.17)
9
+ activerecord-jdbc-adapter (~> 1.3.17)
10
+ jdbc-postgres (>= 9.1)
11
+ activerecord-jdbcsqlite3-adapter (1.3.17)
12
+ activerecord-jdbc-adapter (~> 1.3.17)
13
+ jdbc-sqlite3 (>= 3.7.2, < 3.9)
14
+
15
+ GEM
16
+ remote: https://rubygems.org/
17
+ specs:
18
+ activemodel (3.2.22)
19
+ activesupport (= 3.2.22)
20
+ builder (~> 3.0.0)
21
+ activerecord (3.2.22)
22
+ activemodel (= 3.2.22)
23
+ activesupport (= 3.2.22)
24
+ arel (~> 3.0.2)
25
+ tzinfo (~> 0.3.29)
26
+ activesupport (3.2.22)
27
+ i18n (~> 0.6, >= 0.6.4)
28
+ multi_json (~> 1.0)
29
+ ansi (1.5.0)
30
+ arel (3.0.3)
31
+ builder (3.0.4)
32
+ i18n (0.7.0)
33
+ jdbc-postgres (9.4.1200)
34
+ jdbc-sqlite3 (3.8.10.1)
35
+ minitest (5.8.0)
36
+ minitest-reporters (1.0.19)
37
+ ansi
38
+ builder
39
+ minitest (>= 5.0)
40
+ ruby-progressbar
41
+ multi_json (1.11.2)
42
+ pg (0.18.2)
43
+ rake (10.4.2)
44
+ ruby-progressbar (1.7.5)
45
+ sqlite3 (1.3.10)
46
+ tzinfo (0.3.44)
47
+
48
+ PLATFORMS
49
+ java
50
+ ruby
51
+
52
+ DEPENDENCIES
53
+ activerecord (~> 3.2.22)
54
+ activerecord-jdbc-adapter (>= 1.3.17)!
55
+ activerecord-jdbcpostgresql-adapter
56
+ activerecord-jdbcsqlite3-adapter
57
+ minitest-reporters
58
+ pg
59
+ rake
60
+ sqlite3
61
+
62
+ BUNDLED WITH
63
+ 1.10.6
@@ -0,0 +1,3 @@
1
+ eval File.read("#{File.dirname __FILE__}/common.gemfile")
2
+
3
+ gem 'activerecord', '~>4.0.13'
@@ -0,0 +1,72 @@
1
+ GIT
2
+ remote: git://github.com/jruby/activerecord-jdbc-adapter.git
3
+ revision: 16446e752f07e03eaa6386184039addb42fc3e60
4
+ branch: 1-3-stable
5
+ specs:
6
+ activerecord-jdbc-adapter (1.3.17)
7
+ activerecord (>= 2.2)
8
+ activerecord-jdbcpostgresql-adapter (1.3.17)
9
+ activerecord-jdbc-adapter (~> 1.3.17)
10
+ jdbc-postgres (>= 9.1)
11
+ activerecord-jdbcsqlite3-adapter (1.3.17)
12
+ activerecord-jdbc-adapter (~> 1.3.17)
13
+ jdbc-sqlite3 (>= 3.7.2, < 3.9)
14
+
15
+ GEM
16
+ remote: https://rubygems.org/
17
+ specs:
18
+ activemodel (4.0.13)
19
+ activesupport (= 4.0.13)
20
+ builder (~> 3.1.0)
21
+ activerecord (4.0.13)
22
+ activemodel (= 4.0.13)
23
+ activerecord-deprecated_finders (~> 1.0.2)
24
+ activesupport (= 4.0.13)
25
+ arel (~> 4.0.0)
26
+ activerecord-deprecated_finders (1.0.4)
27
+ activesupport (4.0.13)
28
+ i18n (~> 0.6, >= 0.6.9)
29
+ minitest (~> 4.2)
30
+ multi_json (~> 1.3)
31
+ thread_safe (~> 0.1)
32
+ tzinfo (~> 0.3.37)
33
+ ansi (1.5.0)
34
+ arel (4.0.2)
35
+ builder (3.1.4)
36
+ hashie (3.4.2)
37
+ i18n (0.7.0)
38
+ jdbc-postgres (9.4.1200)
39
+ jdbc-sqlite3 (3.8.10.1)
40
+ minitest (4.7.5)
41
+ minitest-reporters (0.14.24)
42
+ ansi
43
+ builder
44
+ minitest (>= 2.12, < 5.0)
45
+ powerbar
46
+ multi_json (1.11.2)
47
+ pg (0.18.2)
48
+ powerbar (1.0.12)
49
+ ansi (~> 1.5.0)
50
+ hashie (>= 1.1.0)
51
+ rake (10.4.2)
52
+ sqlite3 (1.3.10)
53
+ thread_safe (0.3.5)
54
+ thread_safe (0.3.5-java)
55
+ tzinfo (0.3.44)
56
+
57
+ PLATFORMS
58
+ java
59
+ ruby
60
+
61
+ DEPENDENCIES
62
+ activerecord (~> 4.0.13)
63
+ activerecord-jdbc-adapter (>= 1.3.17)!
64
+ activerecord-jdbcpostgresql-adapter
65
+ activerecord-jdbcsqlite3-adapter
66
+ minitest-reporters
67
+ pg
68
+ rake
69
+ sqlite3
70
+
71
+ BUNDLED WITH
72
+ 1.10.6
@@ -0,0 +1,3 @@
1
+ eval File.read("#{File.dirname __FILE__}/common.gemfile")
2
+
3
+ gem 'activerecord', '~>4.1.12'
@@ -0,0 +1,69 @@
1
+ GIT
2
+ remote: git://github.com/jruby/activerecord-jdbc-adapter.git
3
+ revision: 16446e752f07e03eaa6386184039addb42fc3e60
4
+ branch: 1-3-stable
5
+ specs:
6
+ activerecord-jdbc-adapter (1.3.17)
7
+ activerecord (>= 2.2)
8
+ activerecord-jdbcpostgresql-adapter (1.3.17)
9
+ activerecord-jdbc-adapter (~> 1.3.17)
10
+ jdbc-postgres (>= 9.1)
11
+ activerecord-jdbcsqlite3-adapter (1.3.17)
12
+ activerecord-jdbc-adapter (~> 1.3.17)
13
+ jdbc-sqlite3 (>= 3.7.2, < 3.9)
14
+
15
+ GEM
16
+ remote: https://rubygems.org/
17
+ specs:
18
+ activemodel (4.1.12)
19
+ activesupport (= 4.1.12)
20
+ builder (~> 3.1)
21
+ activerecord (4.1.12)
22
+ activemodel (= 4.1.12)
23
+ activesupport (= 4.1.12)
24
+ arel (~> 5.0.0)
25
+ activesupport (4.1.12)
26
+ i18n (~> 0.6, >= 0.6.9)
27
+ json (~> 1.7, >= 1.7.7)
28
+ minitest (~> 5.1)
29
+ thread_safe (~> 0.1)
30
+ tzinfo (~> 1.1)
31
+ ansi (1.5.0)
32
+ arel (5.0.1.20140414130214)
33
+ builder (3.2.2)
34
+ i18n (0.7.0)
35
+ jdbc-postgres (9.4.1200)
36
+ jdbc-sqlite3 (3.8.10.1)
37
+ json (1.8.3)
38
+ json (1.8.3-java)
39
+ minitest (5.8.0)
40
+ minitest-reporters (1.0.19)
41
+ ansi
42
+ builder
43
+ minitest (>= 5.0)
44
+ ruby-progressbar
45
+ pg (0.18.2)
46
+ rake (10.4.2)
47
+ ruby-progressbar (1.7.5)
48
+ sqlite3 (1.3.10)
49
+ thread_safe (0.3.5)
50
+ thread_safe (0.3.5-java)
51
+ tzinfo (1.2.2)
52
+ thread_safe (~> 0.1)
53
+
54
+ PLATFORMS
55
+ java
56
+ ruby
57
+
58
+ DEPENDENCIES
59
+ activerecord (~> 4.1.12)
60
+ activerecord-jdbc-adapter (>= 1.3.17)!
61
+ activerecord-jdbcpostgresql-adapter
62
+ activerecord-jdbcsqlite3-adapter
63
+ minitest-reporters
64
+ pg
65
+ rake
66
+ sqlite3
67
+
68
+ BUNDLED WITH
69
+ 1.10.6
@@ -0,0 +1,3 @@
1
+ eval File.read("#{File.dirname __FILE__}/common.gemfile")
2
+
3
+ gem 'activerecord', '~>4.2.3'
@@ -0,0 +1,69 @@
1
+ GIT
2
+ remote: git://github.com/jruby/activerecord-jdbc-adapter.git
3
+ revision: 16446e752f07e03eaa6386184039addb42fc3e60
4
+ branch: 1-3-stable
5
+ specs:
6
+ activerecord-jdbc-adapter (1.3.17)
7
+ activerecord (>= 2.2)
8
+ activerecord-jdbcpostgresql-adapter (1.3.17)
9
+ activerecord-jdbc-adapter (~> 1.3.17)
10
+ jdbc-postgres (>= 9.1)
11
+ activerecord-jdbcsqlite3-adapter (1.3.17)
12
+ activerecord-jdbc-adapter (~> 1.3.17)
13
+ jdbc-sqlite3 (>= 3.7.2, < 3.9)
14
+ jdbc-postgres (9.3.1102)
15
+ jdbc-sqlite3 (3.7.2.1)
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ activemodel (4.2.3)
21
+ activesupport (= 4.2.3)
22
+ builder (~> 3.1)
23
+ activerecord (4.2.3)
24
+ activemodel (= 4.2.3)
25
+ activesupport (= 4.2.3)
26
+ arel (~> 6.0)
27
+ activesupport (4.2.3)
28
+ i18n (~> 0.7)
29
+ json (~> 1.7, >= 1.7.7)
30
+ minitest (~> 5.1)
31
+ thread_safe (~> 0.3, >= 0.3.4)
32
+ tzinfo (~> 1.1)
33
+ ansi (1.5.0)
34
+ arel (6.0.3)
35
+ builder (3.2.2)
36
+ i18n (0.7.0)
37
+ json (1.8.3)
38
+ json (1.8.3-java)
39
+ minitest (5.8.0)
40
+ minitest-reporters (1.0.19)
41
+ ansi
42
+ builder
43
+ minitest (>= 5.0)
44
+ ruby-progressbar
45
+ pg (0.18.2)
46
+ rake (10.4.2)
47
+ ruby-progressbar (1.7.5)
48
+ sqlite3 (1.3.10)
49
+ thread_safe (0.3.5)
50
+ thread_safe (0.3.5-java)
51
+ tzinfo (1.2.2)
52
+ thread_safe (~> 0.1)
53
+
54
+ PLATFORMS
55
+ java
56
+ ruby
57
+
58
+ DEPENDENCIES
59
+ activerecord (~> 4.2.3)
60
+ activerecord-jdbc-adapter (>= 1.3.17)!
61
+ activerecord-jdbcpostgresql-adapter
62
+ activerecord-jdbcsqlite3-adapter
63
+ minitest-reporters
64
+ pg
65
+ rake
66
+ sqlite3
67
+
68
+ BUNDLED WITH
69
+ 1.10.6
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+
3
+ platform :jruby do
4
+ gem 'activerecord-jdbc-adapter', '>= 1.3.17',
5
+ github: 'jruby/activerecord-jdbc-adapter',
6
+ branch: '1-3-stable'
7
+ gem 'activerecord-jdbcpostgresql-adapter'
8
+ gem 'activerecord-jdbcsqlite3-adapter'
9
+ end
10
+
11
+ platform :ruby do
12
+ gem 'pg'
13
+ gem 'sqlite3'
14
+ end
15
+
16
+ gem 'minitest-reporters'
17
+ gem 'rake'
@@ -1,11 +1,11 @@
1
1
  require 'activerecord-time/version'
2
2
  require 'active_record/version'
3
3
  require 'time_of_day'
4
- # TODO(uwe): Simplify when we stop supporing ActiveRecord 3.2
4
+ # TODO(uwe): Simplify when we stop supporting ActiveRecord 3.2
5
5
  if ActiveRecord::VERSION::MAJOR < 3 ||
6
6
  (ActiveRecord::VERSION::MAJOR == 3 && ActiveRecord::VERSION::MINOR < 2)
7
7
  raise 'activerecord-time only supports ActiveRecord 3.2.21 or later'
8
- # TODO(uwe): Simplify when we stop supporing ActiveRecord 4.0 and 4.1
8
+ # TODO(uwe): Simplify when we stop supporting ActiveRecord 4.0 and 4.1
9
9
  elsif ActiveRecord::VERSION::MAJOR == 3 ||
10
10
  (ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR <= 1)
11
11
  require 'activerecord-time/extension_until_4_1'
@@ -1,5 +1,3 @@
1
- require 'active_record/type/time'
2
-
3
1
  module ActiveRecord
4
2
  module ConnectionAdapters
5
3
  module Quoting
@@ -1,5 +1,4 @@
1
1
  require 'active_record/connection_adapters/abstract/quoting'
2
- require 'active_record/connection_adapters/sqlite3_adapter'
3
2
 
4
3
  module ActiveRecord
5
4
  module ConnectionAdapters
@@ -1,5 +1,5 @@
1
1
  module Activerecord
2
2
  module Time
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ require 'yaml'
4
+ travis = YAML.load(File.read('.travis.yml'))
5
+
6
+ travis['rvm'].each do |ruby|
7
+ puts '#' * 80
8
+ puts "Testing #{ruby}"
9
+ puts
10
+ system "rvm install #{ruby}"
11
+ exit $? unless $? == 0
12
+ system "rvm #{ruby} do gem install bundler"
13
+ exit $? unless $? == 0
14
+ travis['gemfile'].each do |gemfile|
15
+ puts '$' * 80
16
+ puts "Testing #{gemfile}"
17
+ puts
18
+ ENV['BUNDLE_GEMFILE'] = gemfile
19
+ system "rvm #{ruby} do bundle install"
20
+ exit $?.exitstatus unless $? == 0
21
+ travis['env'].each do |env|
22
+ env.scan(/\b(?<key>[A-Z_]+)="?(?<value>.+?)"?\b/) do |key, value|
23
+ ENV[key] = value
24
+ puts '*' * 80
25
+ puts "Testing #{ruby} #{gemfile} #{env}"
26
+ puts
27
+ system "rvm #{ruby} do bundle exec rake"
28
+ exit $? unless $? == 0
29
+ puts '*' * 80
30
+ end
31
+ end
32
+ puts "Testing #{gemfile} OK"
33
+ puts '$' * 80
34
+ end
35
+ puts "Testing #{ruby} OK"
36
+ puts '#' * 80
37
+ end
38
+
39
+ print "\033[0;32m"
40
+ print ' TESTS PASSED OK!'
41
+ puts "\033[0m"
@@ -2,5 +2,6 @@ ActiveRecord::Schema.define(version: 1) do
2
2
  create_table :events do |t|
3
3
  t.string :name
4
4
  t.time :start_at
5
+ t.binary :content
5
6
  end
6
7
  end
@@ -11,6 +11,7 @@ require 'active_record'
11
11
  require 'activerecord-time'
12
12
  require 'logger'
13
13
  require 'fileutils'
14
+ require 'yaml'
14
15
 
15
16
  FileUtils.rm_rf File.expand_path(':memory:', File.dirname(__FILE__))
16
17
  config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
@@ -39,7 +39,7 @@ class TimeOfDayTest < Minitest::Test
39
39
  end
40
40
 
41
41
  def test_column_type
42
- assert_equal [:integer, :string, :time], Event.columns.map(&:type)
42
+ assert_equal [:integer, :string, :time, :binary], Event.columns.map(&:type)
43
43
  end
44
44
 
45
45
  def test_activerecord
@@ -65,4 +65,19 @@ class TimeOfDayTest < Minitest::Test
65
65
  t.destroy
66
66
  end
67
67
 
68
+ def test_activerecord_binary_column
69
+ text = 'Some binary content'
70
+ Event.create! content: text
71
+ e = Event.where(content: text).first
72
+ assert_equal text, e.content
73
+
74
+ # TODO(uwe): Simplify when we stop supporting ActiveRecord 3
75
+ if ActiveRecord::VERSION::MAJOR >= 4
76
+ e.update! content: 'Other binary content'
77
+ else
78
+ e.update_attributes! content: 'Other binary content'
79
+ end
80
+ # ODOT
81
+ end
82
+
68
83
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-time
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uwe Kubosch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-04 00:00:00.000000000 Z
11
+ date: 2015-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -102,12 +102,21 @@ files:
102
102
  - README.md
103
103
  - Rakefile
104
104
  - activerecord-time.gemspec
105
+ - gemfiles/ar32.gemfile
106
+ - gemfiles/ar32.gemfile.lock
107
+ - gemfiles/ar40.gemfile
108
+ - gemfiles/ar40.gemfile.lock
109
+ - gemfiles/ar41.gemfile
110
+ - gemfiles/ar41.gemfile.lock
111
+ - gemfiles/ar42.gemfile
112
+ - gemfiles/ar42.gemfile.lock
113
+ - gemfiles/common.gemfile
105
114
  - lib/activerecord-time.rb
106
115
  - lib/activerecord-time/extension_4_2.rb
107
116
  - lib/activerecord-time/extension_until_4_1.rb
108
117
  - lib/activerecord-time/version.rb
109
118
  - lib/time_of_day.rb
110
- - matrix_test.sh
119
+ - matrix_test.rb
111
120
  - test/database.yml
112
121
  - test/schema.rb
113
122
  - test/test_helper.rb
@@ -1,20 +0,0 @@
1
- #!/bin/bash -el
2
-
3
- for rb in ruby jruby-head ; do
4
- rvm use $rb
5
- for AR_VERSION in "~>4.2.1" "~>4.1.10" "~>4.0.13" "~>3.2.21" ; do
6
- export AR_VERSION
7
- bundle update
8
- for DB in postgresql sqlite3 ; do
9
- export DB
10
- echo
11
- echo Testing $rb $DB $AR_VERSION
12
- echo
13
- bundle exec rake
14
- done
15
- done
16
- done
17
-
18
- echo -e "\033[0;32m"
19
- echo -e " TESTS PASSED OK!"
20
- echo -e "\033[0m"