pluckex 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pluckex/{active_record/relation/calculations.rb → calculations.rb} +1 -1
- data/lib/pluckex/version.rb +1 -1
- data/lib/pluckex.rb +3 -3
- data/pluckex.gemspec +2 -0
- data/spec/lib/pluckex_spec.rb +25 -0
- data/spec/pluckex.sqlite3 +0 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/support/data.rb +2 -0
- data/spec/support/models.rb +2 -0
- data/spec/support/schema.rb +9 -0
- metadata +41 -5
- data/spec/pluckex_spec.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2687ada5f02845f7a2e8f6c4b5a229cc22f7cff
|
4
|
+
data.tar.gz: e69865d5537d47a09e84e6c152b93a53d5a58f64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59e6abb9f46f6189a0669303d38d4380f82e84c1d5bbf1441f8201c5542d20e9bd0b49ad520ccc71198d950f1d22e128bec07f84a7cfbcc5ecfa95fdd70c7824
|
7
|
+
data.tar.gz: 808126460bc9fbca57d40279d89989c4175d929f82eab07b90623688d554d1b373217a758f29bb672ae348ad53355b0b3186650033a0ffa1e80dc59baed27d8b
|
data/lib/pluckex/version.rb
CHANGED
data/lib/pluckex.rb
CHANGED
data/pluckex.gemspec
CHANGED
@@ -21,4 +21,6 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.7"
|
22
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
23
|
spec.add_development_dependency "rspec"
|
24
|
+
spec.add_development_dependency "sqlite3"
|
25
|
+
spec.add_development_dependency "activerecord"
|
24
26
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Pluckex do
|
4
|
+
describe 'activerecord extention' do
|
5
|
+
let(:people) { Person.all }
|
6
|
+
describe 'pluck_tied_by_id' do
|
7
|
+
subject { Person.pluck_tied_by_id(:name) }
|
8
|
+
it do
|
9
|
+
expect(subject).to eq(
|
10
|
+
people.first.id => people.first.name,
|
11
|
+
people.second.id => people.second.name,
|
12
|
+
)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
describe 'pluck_with_keys' do
|
16
|
+
subject { Person.pluck_with_keys(:id, :name) }
|
17
|
+
it do
|
18
|
+
expect(subject).to eq([
|
19
|
+
{:id => people.first.id, :name => people.first.name},
|
20
|
+
{:id => people.second.id, :name => people.second.name},
|
21
|
+
])
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
Binary file
|
data/spec/spec_helper.rb
CHANGED
@@ -1,2 +1,11 @@
|
|
1
1
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
2
|
require 'pluckex'
|
3
|
+
|
4
|
+
ActiveRecord::Base.establish_connection(
|
5
|
+
:adapter => "sqlite3",
|
6
|
+
:database => File.dirname(__FILE__) + "/pluckex.sqlite3"
|
7
|
+
)
|
8
|
+
|
9
|
+
load File.dirname(__FILE__) + '/support/schema.rb'
|
10
|
+
load File.dirname(__FILE__) + '/support/models.rb'
|
11
|
+
load File.dirname(__FILE__) + '/support/data.rb'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pluckex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daiki Taniguchi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sqlite3
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activerecord
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
description: Pluckex!
|
56
84
|
email:
|
57
85
|
- daiki.taniguchi@aktsk.jp
|
@@ -67,11 +95,15 @@ files:
|
|
67
95
|
- README.md
|
68
96
|
- Rakefile
|
69
97
|
- lib/pluckex.rb
|
70
|
-
- lib/pluckex/
|
98
|
+
- lib/pluckex/calculations.rb
|
71
99
|
- lib/pluckex/version.rb
|
72
100
|
- pluckex.gemspec
|
73
|
-
- spec/pluckex_spec.rb
|
101
|
+
- spec/lib/pluckex_spec.rb
|
102
|
+
- spec/pluckex.sqlite3
|
74
103
|
- spec/spec_helper.rb
|
104
|
+
- spec/support/data.rb
|
105
|
+
- spec/support/models.rb
|
106
|
+
- spec/support/schema.rb
|
75
107
|
homepage: ''
|
76
108
|
licenses:
|
77
109
|
- MIT
|
@@ -97,6 +129,10 @@ signing_key:
|
|
97
129
|
specification_version: 4
|
98
130
|
summary: Pluckex.
|
99
131
|
test_files:
|
100
|
-
- spec/pluckex_spec.rb
|
132
|
+
- spec/lib/pluckex_spec.rb
|
133
|
+
- spec/pluckex.sqlite3
|
101
134
|
- spec/spec_helper.rb
|
135
|
+
- spec/support/data.rb
|
136
|
+
- spec/support/models.rb
|
137
|
+
- spec/support/schema.rb
|
102
138
|
has_rdoc:
|