smartystreets_ruby_sdk 4.0.1 → 4.1.3

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.
data/Makefile CHANGED
@@ -1,22 +1,20 @@
1
1
  #!/usr/bin/make -f
2
2
 
3
- SOURCE_VERSION := 4.0
4
-
5
3
  tests:
6
4
  ruby -Ilib -e 'ARGV.each { |f| require f }' ./test/smartystreets_ruby_sdk/test*.rb ./test/smartystreets_ruby_sdk/us_street/test*.rb ./test/smartystreets_ruby_sdk/us_zipcode/test*.rb
7
5
 
8
- publish: version
9
- git push origin --tags
6
+ publish-patch:
7
+ @python tag.py patch
8
+ git describe
10
9
  gem build smartystreets_ruby_sdk.gemspec
11
- gem push smartystreets_ruby_sdk-$(shell git describe).gem
12
- git checkout lib/smartystreets_ruby_sdk/version.rb
10
+ gem push smartystreets_ruby_sdk-`git describe`.gem
13
11
 
14
- version: tag
15
- @sed -i -r "s/0\.0\.0/$(shell git describe)/g" lib/smartystreets_ruby_sdk/version.rb
12
+ publish-minor:
13
+ @python tag.py minor
14
+ gem build smartystreets_ruby_sdk.gemspec
15
+ gem push smartystreets_ruby_sdk-$(shell git describe).gem
16
16
 
17
- tag:
18
- $(eval PREFIX := $(SOURCE_VERSION).)
19
- $(eval CURRENT := $(shell git describe 2>/dev/null))
20
- $(eval EXPECTED := $(PREFIX)$(shell git tag -l "$(PREFIX)*" | wc -l | xargs expr -1 +))
21
- $(eval INCREMENTED := $(PREFIX)$(shell git tag -l "$(PREFIX)*" | wc -l | xargs expr 0 +))
22
- @if [ "$(CURRENT)" != "$(EXPECTED)" ]; then git tag -a "$(INCREMENTED)" -m "" 2>/dev/null || true; fi
17
+ publish-major:
18
+ @python tag.py major
19
+ gem build smartystreets_ruby_sdk.gemspec
20
+ gem push smartystreets_ruby_sdk-$(shell git describe).gem
@@ -3,13 +3,14 @@ module SmartyStreets
3
3
  # See "https://smartystreets.com/docs/cloud/international-street-api#metadata"
4
4
  class Metadata
5
5
 
6
- attr_reader :longitude, :geocode_precision, :max_geocode_precision, :latitude
6
+ attr_reader :longitude, :geocode_precision, :max_geocode_precision, :latitude, :address_format
7
7
 
8
8
  def initialize(obj)
9
9
  @latitude = obj.fetch('latitude', nil)
10
10
  @longitude = obj.fetch('longitude', nil)
11
11
  @geocode_precision = obj.fetch('geocode_precision', nil)
12
12
  @max_geocode_precision = obj.fetch('max_geocode_precision', nil)
13
+ @address_format = obj.fetch('address_format', nil)
13
14
  end
14
15
  end
15
16
  end
@@ -1,3 +1,3 @@
1
1
  module SmartyStreets
2
- VERSION = '4.0.1' # DO NOT EDIT (this is updated by a build job when a new release is published)
2
+ VERSION = '4.1.3' # DO NOT EDIT (this is updated by a build job when a new release is published)
3
3
  end
data/tag.py ADDED
@@ -0,0 +1,53 @@
1
+ import subprocess
2
+ import sys
3
+
4
+ INCREMENTS = {
5
+ "patch": 2,
6
+ "minor": 1,
7
+ "major": 0,
8
+ }
9
+
10
+ def main():
11
+ increment = sys.argv[-1]
12
+ if increment not in ['patch', 'minor', 'major']:
13
+ print 'Invalid INCREMENT value. Please use "patch", "minor", or "major".'
14
+ os.Exit(1)
15
+
16
+ increment = INCREMENTS[increment]
17
+
18
+ current = subprocess.check_output("git describe", shell=True).split()
19
+ last_stable = subprocess.check_output("git tag -l", shell=True).strip().split('\n')[-1]
20
+ if current == last_stable:
21
+ return
22
+
23
+ last_stable_split = last_stable.split('.')
24
+ last_stable_split[increment] = str(int(last_stable_split[increment]) + 1)
25
+
26
+ if increment == 0:
27
+ last_stable_split[1] = "0"
28
+ last_stable_split[2] = "0"
29
+
30
+ if increment == 1:
31
+ last_stable_split[2] = "0"
32
+
33
+ incremented = '.'.join(last_stable_split)
34
+ print incremented
35
+
36
+ replace_in_file('lib/smartystreets_ruby_sdk/version.rb', last_stable, incremented)
37
+
38
+ subprocess.check_call('git add lib/smartystreets_ruby_sdk/version.rb', shell=True)
39
+ subprocess.check_call('git commit -m "Incremented version number to {0}"'.format(incremented), shell=True)
40
+ subprocess.check_call('git tag -a {0} -m "{0}"'.format(incremented), shell=True)
41
+ subprocess.check_call('git push origin master --tags', shell=True)
42
+
43
+
44
+ def replace_in_file(filename, search, replace):
45
+ with open(filename) as source:
46
+ updated = source.read().replace(search, replace)
47
+
48
+ with open(filename, 'w') as update:
49
+ update.write(updated)
50
+
51
+
52
+ if __name__ == '__main__':
53
+ main()
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartystreets_ruby_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -161,6 +161,7 @@ files:
161
161
  - lib/smartystreets_ruby_sdk/version.rb
162
162
  - ruby-sdk-demo.json
163
163
  - smartystreets_ruby_sdk.gemspec
164
+ - tag.py
164
165
  homepage: https://github.com/smartystreets/smartystreets-ruby-sdk
165
166
  licenses:
166
167
  - Apache-2.0