hsql 0.4.0 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f0f814ecf9e392ba9fdaf7b9ca4189cf5d938ce
4
- data.tar.gz: 03b44002a2c25d8ae9aad92662e942af90f30d4c
3
+ metadata.gz: 9a103cbdb9c7ac85ac94e45f674a9f3d52b57630
4
+ data.tar.gz: a4f342333263639276c2809ab7550098b5837ea7
5
5
  SHA512:
6
- metadata.gz: f403e66309574a45a882bfb52150273a83d15ed2868b382bc89520943128459d7888b36f4fdfcbed03f8ca39be6adb6b1ff19845baf82035f2c7da388e7843b4
7
- data.tar.gz: d789ce8019449d9b7cf20d61ee84cca6f4584dba60750074d1d9a1b288c6109e706b0e93c4eb2a4e9834a78b798078a0ad54685f95754632d82588c68b5f92f7
6
+ metadata.gz: f3b01532699b00040ce951221807929789badf2c26327f48467d339ebad5fd7f9711eeec59c80a2d76fe35bd044c85018211a32f4ead0fe4e9d0a20dc8236bfb
7
+ data.tar.gz: 20a5d910c8310d9681e62f3ea0dd2c1067a9006aecff9e349ebcc72abec9e4b3caa1d148bb149b721353216f3c040780d709d4cea7d743d11cdd91b83a75c29a
@@ -1,7 +1,4 @@
1
1
 
2
- Style/TrailingComma:
3
- EnforcedStyleForMultiline: comma
4
-
5
2
  Metrics/LineLength:
6
3
  Max: 110
7
4
 
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_dependency 'mustache', '> 0'
23
23
  spec.add_dependency 'activesupport', '> 0'
24
- spec.add_dependency 'pg_query', '>= 0.6.4'
24
+ spec.add_dependency 'pg_query', '~> 0.8.0'
25
25
  spec.add_development_dependency 'bundler', '~> 1.10'
26
- spec.add_development_dependency 'rubocop', '~> 0.3'
26
+ spec.add_development_dependency 'rubocop', '0.37.2'
27
27
  spec.add_development_dependency 'rake', '> 0'
28
28
  spec.add_development_dependency 'rspec', '~> 3.3'
29
29
  spec.add_development_dependency 'timecop', '~> 0.8.0'
@@ -37,7 +37,7 @@ module HSQL
37
37
  moments = []
38
38
 
39
39
  moments += [
40
- ['now', moment, 'The moment provided via --date or --timestamp (defaults to the current system time)'],
40
+ ['now', moment, 'The moment provided via --date or --timestamp (defaults to the current system time)']
41
41
  ]
42
42
 
43
43
  moments += [
@@ -52,41 +52,41 @@ module HSQL
52
52
  ['end_of_week', moment.end_of_week, 'The last second of the week'],
53
53
  ['end_of_month', moment.end_of_month, 'The last second of the month'],
54
54
  ['end_of_quarter', moment.end_of_quarter, 'The last second of the quarter'],
55
- ['end_of_year', moment.end_of_year, 'The last second of the year'],
55
+ ['end_of_year', moment.end_of_year, 'The last second of the year']
56
56
  ]
57
57
 
58
58
  # Time ranges immediately preceding the one in which `time` appears.
59
59
  moment = time - 1.hour
60
60
  moments += [
61
61
  ['beginning_of_previous_hour', moment.beginning_of_hour, 'The first second of the previous hour'],
62
- ['end_of_previous_hour', moment.end_of_hour, 'The last second of the previous hour'],
62
+ ['end_of_previous_hour', moment.end_of_hour, 'The last second of the previous hour']
63
63
  ]
64
64
 
65
65
  moment = time - 1.day
66
66
  moments += [
67
67
  ['beginning_of_previous_day', moment.beginning_of_day, 'The first second of the previous day'],
68
- ['end_of_previous_day', moment.end_of_day, 'The last second of the previous day'],
68
+ ['end_of_previous_day', moment.end_of_day, 'The last second of the previous day']
69
69
  ]
70
70
 
71
71
  moment = time - 1.week
72
72
  moments += [
73
73
  ['beginning_of_previous_week', moment.beginning_of_week, 'The first second of the previous week'],
74
- ['end_of_previous_week', moment.end_of_week, 'The last second of the previous week'],
74
+ ['end_of_previous_week', moment.end_of_week, 'The last second of the previous week']
75
75
  ]
76
76
  moment = time - 1.month
77
77
  moments += [
78
78
  ['beginning_of_previous_month', moment.beginning_of_month, 'The first second of the previous month'],
79
- ['end_of_previous_month', moment.end_of_month, 'The last second of the previous month'],
79
+ ['end_of_previous_month', moment.end_of_month, 'The last second of the previous month']
80
80
  ]
81
81
  moment = time - 3.months
82
82
  moments += [
83
83
  ['beginning_of_previous_quarter', moment.beginning_of_quarter, 'The first second of the previous quarter'],
84
- ['end_of_previous_quarter', moment.end_of_quarter, 'The last second of the previous quarter'],
84
+ ['end_of_previous_quarter', moment.end_of_quarter, 'The last second of the previous quarter']
85
85
  ]
86
86
  moment = time - 1.year
87
87
  moments += [
88
88
  ['beginning_of_previous_year', moment.beginning_of_year, 'The first second of the previous year'],
89
- ['end_of_previous_year', moment.end_of_year, 'The last second of the previous year'],
89
+ ['end_of_previous_year', moment.end_of_year, 'The last second of the previous year']
90
90
  ]
91
91
 
92
92
  moments
@@ -28,13 +28,9 @@ module HSQL
28
28
  new(source, options).parse!
29
29
  end
30
30
 
31
- def to_yaml
32
- metadata.to_yaml
33
- end
31
+ delegate :to_yaml, to: :metadata
34
32
 
35
- def to_json
36
- metadata.to_json
37
- end
33
+ delegate :to_json, to: :metadata
38
34
 
39
35
  def metadata
40
36
  @metadata ||= begin
@@ -15,6 +15,6 @@ module HSQL
15
15
  def to_s
16
16
  PgQuery::Deparse.from ast
17
17
  end
18
- alias_method :to_sql, :to_s
18
+ alias to_sql to_s
19
19
  end
20
20
  end
@@ -35,7 +35,7 @@ module HSQL
35
35
  message = "Missing variable {{{ #{tag} }}}. At this point in the template the available variables are:"
36
36
  message += "\n"
37
37
  message += keys.join(', ')
38
- fail FormatError, message
38
+ raise FormatError, message
39
39
  end
40
40
 
41
41
  def ast
@@ -1,4 +1,4 @@
1
1
  # http://semver.org/
2
2
  module HSQL
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.1'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hsql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Danger Canty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-06 00:00:00.000000000 Z
11
+ date: 2016-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mustache
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: pg_query
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.6.4
47
+ version: 0.8.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.6.4
54
+ version: 0.8.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: rubocop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: '0.3'
75
+ version: 0.37.2
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: '0.3'
82
+ version: 0.37.2
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  version: '0'
188
188
  requirements: []
189
189
  rubyforge_project:
190
- rubygems_version: 2.4.5
190
+ rubygems_version: 2.5.1
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: Store a hash of data with your SQL queries.