quandl_cassinatra 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -40,9 +40,10 @@ module Searchable
40
40
  delegate *Data::Table.forwardable_methods, to: :data_table
41
41
  end
42
42
 
43
- search_scope :limit, ->(amount) { where( limit: amount.to_i ); }
44
- search_scope :offset, ->(amount) { where( offset: amount.to_i ) }
45
- search_scope :accuracy, ->(amount) { where( accuracy: amount.to_i ) }
43
+ search_scope :row, ->(v){ where( row: v.to_i ) }
44
+ search_scope :limit, ->(v){ where( limit: v.to_i ) }
45
+ search_scope :offset, ->(v){ where( offset: v.to_i ) }
46
+ search_scope :accuracy, ->(v){ where( accuracy: v.to_i ) }
46
47
  search_scope :column, ->(index) { where( column: index.to_i ) }
47
48
  search_scope :order, ->(dir) { where( order: (dir.to_sym == :asc) ? 'asc' : 'desc' ) }
48
49
  search_scope :trim_start, ->(date) { where( trim_start: format_trim_date(date, :start)) }
@@ -58,23 +59,6 @@ module Searchable
58
59
  trim_end(trim_end) if trim_end
59
60
  }
60
61
 
61
- # wrap limit, offset, and order with row
62
- search_scope :row, ->(value){
63
- # ensure integer
64
- value = value.to_i
65
- # 0 is the current observation
66
- if value < 0
67
- order(:asc)
68
- offset( (value * -1) - 1 )
69
- limit( 1 )
70
- # postive value is an offset of current observation
71
- else
72
- order(:desc)
73
- offset( value )
74
- limit( 1 )
75
- end
76
- }
77
-
78
62
  search_helper :format_trim_date, ->( date, start_or_end ){
79
63
  date = Date.jd(date) if date.is_a?(Integer)
80
64
  date = Date.parse(date) if date.is_a?(String)
@@ -1,5 +1,5 @@
1
1
  module Quandl
2
2
  module Cassinatra
3
- VERSION = '0.0.14'
3
+ VERSION = '0.0.15'
4
4
  end
5
5
  end
@@ -5,7 +5,7 @@ require "quandl/cassinatra/version"
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "quandl_cassinatra"
7
7
  s.version = Quandl::Cassinatra::VERSION
8
- s.authors = ["Blkae Hilscher"]
8
+ s.authors = ["Blake Hilscher"]
9
9
  s.email = ["blake@hilscher.ca"]
10
10
  s.homepage = "http://blake.hilscher.ca/"
11
11
  s.license = "MIT"
@@ -24,8 +24,9 @@ Gem::Specification.new do |s|
24
24
 
25
25
  s.add_runtime_dependency "activesupport", ">= 3.0.0"
26
26
  s.add_runtime_dependency "her", "~> 0.6.7"
27
- s.add_runtime_dependency "scope_builder", "~> 0.0.6"
28
- s.add_runtime_dependency "quandl_data", "~> 0.0.8"
29
27
  s.add_runtime_dependency "yajl-ruby", "~> 1.1.0"
30
28
  s.add_runtime_dependency 'json', '~> 1.7.7'
29
+
30
+ s.add_runtime_dependency "scope_builder", ">= 0.0.7"
31
+ s.add_runtime_dependency "quandl_data", ">= 0.0.12"
31
32
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl_cassinatra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - Blkae Hilscher
8
+ - Blake Hilscher
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-18 00:00:00.000000000 Z
12
+ date: 2013-07-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -108,13 +108,13 @@ dependencies:
108
108
  - !ruby/object:Gem::Version
109
109
  version: 0.6.7
110
110
  - !ruby/object:Gem::Dependency
111
- name: scope_builder
111
+ name: yajl-ruby
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 0.0.6
117
+ version: 1.1.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -122,15 +122,15 @@ dependencies:
122
122
  requirements:
123
123
  - - ~>
124
124
  - !ruby/object:Gem::Version
125
- version: 0.0.6
125
+ version: 1.1.0
126
126
  - !ruby/object:Gem::Dependency
127
- name: quandl_data
127
+ name: json
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
131
  - - ~>
132
132
  - !ruby/object:Gem::Version
133
- version: 0.0.8
133
+ version: 1.7.7
134
134
  type: :runtime
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
@@ -138,39 +138,39 @@ dependencies:
138
138
  requirements:
139
139
  - - ~>
140
140
  - !ruby/object:Gem::Version
141
- version: 0.0.8
141
+ version: 1.7.7
142
142
  - !ruby/object:Gem::Dependency
143
- name: yajl-ruby
143
+ name: scope_builder
144
144
  requirement: !ruby/object:Gem::Requirement
145
145
  none: false
146
146
  requirements:
147
- - - ~>
147
+ - - '>='
148
148
  - !ruby/object:Gem::Version
149
- version: 1.1.0
149
+ version: 0.0.7
150
150
  type: :runtime
151
151
  prerelease: false
152
152
  version_requirements: !ruby/object:Gem::Requirement
153
153
  none: false
154
154
  requirements:
155
- - - ~>
155
+ - - '>='
156
156
  - !ruby/object:Gem::Version
157
- version: 1.1.0
157
+ version: 0.0.7
158
158
  - !ruby/object:Gem::Dependency
159
- name: json
159
+ name: quandl_data
160
160
  requirement: !ruby/object:Gem::Requirement
161
161
  none: false
162
162
  requirements:
163
- - - ~>
163
+ - - '>='
164
164
  - !ruby/object:Gem::Version
165
- version: 1.7.7
165
+ version: 0.0.12
166
166
  type: :runtime
167
167
  prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
169
169
  none: false
170
170
  requirements:
171
- - - ~>
171
+ - - '>='
172
172
  - !ruby/object:Gem::Version
173
- version: 1.7.7
173
+ version: 0.0.12
174
174
  description: An orm for the cassinatra rest interface.
175
175
  email:
176
176
  - blake@hilscher.ca