espresso_path 0.1.0 → 0.1.2

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: 9bdd04c1f4d2b3f8811918f79fc954918018d4c7
4
- data.tar.gz: 6ac5fb5e0a9755a901a79ebaf6b6fedb94a17e79
3
+ metadata.gz: 0a3ed47ad878df69d7c5c11e3a00f9fb69f4acea
4
+ data.tar.gz: bd30d00e9c9ea364c2163c2e7fbf56d45f8785b7
5
5
  SHA512:
6
- metadata.gz: 049375564d0d21e1f746b8c46fd46762a1f045b899b3e8b759bcbed67553a5c2700d14c04a8487e6340dd4245def7f4a78804fad20d901827e40557cf7f2733d
7
- data.tar.gz: 5848964a6fb6e1a804b641aa279d8126d71fd3fb3f7cdd054ecb19aeb00f858243d0e2752b3c617916ea24c32ad88ba3e8f5a68a73e9d43eeda3801e392d934d
6
+ metadata.gz: 7c15e79bd98b84e5e1037640ce34996944ba88ebea417dd945281d64edb907ad254f27162d113082ba49e1ca93f9c03cf903772a0a871e02ed2974a56da1e187
7
+ data.tar.gz: cd076c9919405aded827e14e3e70215ac8c48280f585b711809cbfda82835880b1b5110f826bd6877a739593b3e8ec70a3fae624555b908e2d11b93101de4aa2
data/.gitignore CHANGED
@@ -13,4 +13,6 @@
13
13
  .idea
14
14
  .idea/*
15
15
  /.env
16
+ *.gem
16
17
 
18
+ coveragere
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.1.1] - 2018-01-19
8
+ ### Added
9
+ - Migrating to `EspressoPath::Client` instead of `EspressoPath::GeoPath`
10
+ - [CONTRIBUTING.md](CONTRIBUTING.md) file - @cdesch
11
+ - [CHANGELOG.md](CHANGELOG.md) file - @cdesch
12
+
13
+ ## [0.1.0] - 2018-01-18
14
+ ### Added
15
+ - Initial Release - @cdesch
@@ -0,0 +1,94 @@
1
+ # Contributing
2
+
3
+ When contributing to this repository, please first discuss the change you wish to make via issue,
4
+ email, or any other method with the owners of this repository before making a change.
5
+
6
+ Please note we have a code of conduct, please follow it in all your interactions with the project.
7
+
8
+ ## Pull Request Process
9
+
10
+ 1. Ensure any install or build dependencies are removed before the end of the layer when doing a
11
+ build.
12
+ 2. Update the [CHANGELOG.md](CHANGELOG.md) with details of changes to the interface, this includes new environment
13
+ variables, exposed ports, useful file locations and container parameters.
14
+ 3. Increase the version numbers in any examples files and the [README.md](README.md) to the new version that this
15
+ Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
16
+ 4. Run the tests (`rspec`), code coverage (`simplecov`), and static analysis tools (`rubocop`) as follows:
17
+
18
+ rspec
19
+ rubocop
20
+
21
+ ## Code of Conduct
22
+
23
+ ### Our Pledge
24
+
25
+ In the interest of fostering an open and welcoming environment, we as
26
+ contributors and maintainers pledge to making participation in our project and
27
+ our community a harassment-free experience for everyone, regardless of age, body
28
+ size, disability, ethnicity, gender identity and expression, level of experience,
29
+ nationality, personal appearance, race, religion, or sexual identity and
30
+ orientation.
31
+
32
+ ### Our Standards
33
+
34
+ Examples of behavior that contributes to creating a positive environment
35
+ include:
36
+
37
+ * Using welcoming and inclusive language
38
+ * Being respectful of differing viewpoints and experiences
39
+ * Gracefully accepting constructive criticism
40
+ * Focusing on what is best for the community
41
+ * Showing empathy towards other community members
42
+
43
+ Examples of unacceptable behavior by participants include:
44
+
45
+ * The use of sexualized language or imagery and unwelcome sexual attention or
46
+ advances
47
+ * Trolling, insulting/derogatory comments, and personal or political attacks
48
+ * Public or private harassment
49
+ * Publishing others' private information, such as a physical or electronic
50
+ address, without explicit permission
51
+ * Other conduct which could reasonably be considered inappropriate in a
52
+ professional setting
53
+
54
+ ### Our Responsibilities
55
+
56
+ Project maintainers are responsible for clarifying the standards of acceptable
57
+ behavior and are expected to take appropriate and fair corrective action in
58
+ response to any instances of unacceptable behavior.
59
+
60
+ Project maintainers have the right and responsibility to remove, edit, or
61
+ reject comments, commits, code, wiki edits, issues, and other contributions
62
+ that are not aligned to this Code of Conduct, or to ban temporarily or
63
+ permanently any contributor for other behaviors that they deem inappropriate,
64
+ threatening, offensive, or harmful.
65
+
66
+ ### Scope
67
+
68
+ This Code of Conduct applies both within project spaces and in public spaces
69
+ when an individual is representing the project or its community. Examples of
70
+ representing a project or community include using an official project e-mail
71
+ address, posting via an official social media account, or acting as an appointed
72
+ representative at an online or offline event. Representation of a project may be
73
+ further defined and clarified by project maintainers.
74
+
75
+ ### Enforcement
76
+
77
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
78
+ reported by contacting the project team at [contact@kickinespresso.com](mailto:contact@kickinespresso.com). All
79
+ complaints will be reviewed and investigated and will result in a response that
80
+ is deemed necessary and appropriate to the circumstances. The project team is
81
+ obligated to maintain confidentiality with regard to the reporter of an incident.
82
+ Further details of specific enforcement policies may be posted separately.
83
+
84
+ Project maintainers who do not follow or enforce the Code of Conduct in good
85
+ faith may face temporary or permanent repercussions as determined by other
86
+ members of the project's leadership.
87
+
88
+ ### Attribution
89
+
90
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
91
+ available at [http://contributor-covenant.org/version/1/4][version]
92
+
93
+ [homepage]: http://contributor-covenant.org
94
+ [version]: http://contributor-covenant.org/version/1/4/
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018 Chris Desch
3
+ Copyright (c) 2018 KickinEspresso
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -10,7 +10,7 @@ Welcome to your EspressoPath! Espresso Path is GeoPath API Ruby Wrapper
10
10
  Add this line to your application's Gemfile:
11
11
 
12
12
  ```ruby
13
- gem 'espresso_path'
13
+ gem 'espresso_path', '~> 0.1.1'
14
14
  ```
15
15
 
16
16
  And then execute:
@@ -20,6 +20,10 @@ And then execute:
20
20
  Or install it yourself as:
21
21
 
22
22
  $ gem install espresso_path
23
+
24
+ ## Documentation
25
+
26
+ [EspressoPath Docs](http://www.rubydoc.info/gems/espresso_path)
23
27
 
24
28
  ## Testing
25
29
 
@@ -30,6 +34,11 @@ Or install it yourself as:
30
34
  ESPRESSO_PATH_USER_NAME=YourEmail
31
35
  ESPRESSO_PATH_PASSWORD=YourPassword
32
36
 
37
+ 3) Run tests with
38
+
39
+ rspec
40
+
41
+
33
42
  ## Usage
34
43
 
35
44
  TODO: Write usage instructions here
@@ -44,10 +53,29 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
44
53
 
45
54
  Bug reports and pull requests are welcome on GitHub at https://github.com/kickinespresso/espresso_path. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
46
55
 
56
+ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
57
+
58
+ When making pull requests, please be sure to update the [CHANGELOG.md](CHANGELOG.md) with the corresponding changes.
59
+
47
60
 
48
61
  ## License
49
62
 
50
63
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
51
64
 
65
+ ## Sponsors
66
+
67
+ This project is sponsored by [KickinEspresso](https://kickinespresso.com/?utm_source=github&utm_medium=sponsor&utm_campaign=opensource)
68
+
69
+ ## Versioning
70
+
71
+ We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/kickinespresso/ex_gtin/tags).
72
+
73
+
74
+ ## Code of Conduct
75
+
76
+ Please refer to the [Code of Conduct](CODE_OF_CONDUCT.md) for details
77
+
78
+ ## RubyGems
52
79
 
80
+ [EspressoPath on RubyGems](https://rubygems.org/gems/espresso_path)
53
81
 
@@ -0,0 +1,4 @@
1
+ ## Releasing Process
2
+
3
+ gem build espresso_path.gemspec
4
+ gem push espresso_path-0.0.0.gem
@@ -6,7 +6,7 @@ require 'espresso_path/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "espresso_path"
8
8
  spec.version = EspressoPath::VERSION
9
- spec.authors = ["Chris Desch"]
9
+ spec.authors = ["KickinEspresso"]
10
10
  spec.email = ["chris@kickinespresso.com"]
11
11
 
12
12
  spec.summary = %q{GeoPath Ruby API Wrapper}
@@ -29,9 +29,13 @@ Gem::Specification.new do |spec|
29
29
  spec.bindir = "exe"
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
- spec.add_dependency 'httparty'
33
- spec.add_development_dependency 'dotenv', '~> 2.2.1'
32
+ #spec.add_dependency 'httparty'
33
+ spec.add_runtime_dependency 'httparty', '~> 0'
34
+
35
+ spec.add_development_dependency 'dotenv', '~> 2.2', '>= 2.2.1'
34
36
  spec.add_development_dependency "bundler", "~> 1.14"
35
37
  spec.add_development_dependency "rake", "~> 10.0"
36
38
  spec.add_development_dependency "rspec", "~> 3.0"
39
+ spec.add_development_dependency 'simplecov','~> 0.15.1'
40
+ spec.add_development_dependency 'rubocop', '~> 0.52.1'
37
41
  end
@@ -3,6 +3,7 @@ require 'espresso_path/configuration'
3
3
  require 'httparty'
4
4
  require 'json'
5
5
  require 'espresso_path/geo_path'
6
+ require 'espresso_path/client'
6
7
 
7
8
  module EspressoPath
8
9
  class << self
@@ -21,29 +22,4 @@ module EspressoPath
21
22
  yield(configuration)
22
23
  end
23
24
 
24
- def self.login
25
- #uri = URI.parse(EspressoPath.configuration.base_url + "/login")
26
- uri = URI.parse("https://insights-api.geopath.org/login")
27
-
28
- puts uri
29
- http = Net::HTTP.new(uri.host, uri.port)
30
- http.use_ssl = true
31
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
32
- puts EspressoPath.configuration.user_name
33
- request = Net::HTTP::Post.new(uri.request_uri)
34
- request.set_form_data({ :username => EspressoPath.configuration.user_name, :password => EspressoPath.configuration.password })
35
-
36
- response = http.request(request)
37
- puts response.body
38
- puts "here"
39
- body = JSON.parse(response.body)
40
-
41
- EspressoPath.configuration.client_token = body["access_token"]
42
-
43
- EspressoPath.configuration.options = {
44
- headers: {
45
- "Authorization"=> "Bearer #{EspressoPath.configuration.client_token}"
46
- }
47
- }
48
- end
49
25
  end
@@ -0,0 +1,79 @@
1
+ require 'logger'
2
+ require 'httparty'
3
+ require 'json'
4
+
5
+ module EspressoPath
6
+ class Client
7
+ include HTTParty
8
+
9
+ def initialize
10
+ self.class.base_uri EspressoPath.configuration.base_url
11
+ login(EspressoPath.configuration.user_name, EspressoPath.configuration.password)
12
+ end
13
+
14
+ def login(username, password)
15
+ uri = URI.parse(EspressoPath.configuration.base_url + '/login')
16
+ http = Net::HTTP.new(uri.host, uri.port)
17
+ http.use_ssl = true
18
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
19
+ request = Net::HTTP::Post.new(uri.request_uri)
20
+ request.set_form_data(username: username, password: password)
21
+ response = http.request(request)
22
+ body = JSON.parse(response.body)
23
+ @access_token = body['access_token']
24
+ @options = {
25
+ headers: {
26
+ Authorization: "Bearer #{@access_token}"
27
+ }
28
+ }
29
+ end
30
+
31
+ def audience
32
+ self.class.get('/audience', @options)
33
+ end
34
+
35
+ def day_parts
36
+ self.class.get('/day-parts', @options)
37
+ end
38
+
39
+ def counties
40
+ self.class.get('/counties', @options)
41
+ end
42
+
43
+ def custom_demos
44
+ self.class.get('/custom-demos', @options)
45
+ end
46
+
47
+ def media_types
48
+ self.class.get('/media-types', @options)
49
+ end
50
+
51
+ def operators
52
+ self.class.get('/operators', @options)
53
+ end
54
+
55
+ def plants
56
+ self.class.get('/plants', @options)
57
+ end
58
+
59
+ def markets
60
+ self.class.get('/markets', @options)
61
+ end
62
+
63
+ def market(market)
64
+ self.class.get("/markets/#{market}", @options)
65
+ end
66
+
67
+ def panels
68
+ self.class.get('/panels', @options)
69
+ end
70
+
71
+ def demo_categories
72
+ self.class.get('/demos/categories', @options)
73
+ end
74
+
75
+ def states
76
+ self.class.get('/states', @options)
77
+ end
78
+ end
79
+ end
File without changes
@@ -1,3 +1,3 @@
1
1
  module EspressoPath
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -12,6 +12,3 @@ EspressoPath.configure do |config|
12
12
  config.client_token = ENV['ESPRESSO_PATH_CLIENT_TOKEN']
13
13
 
14
14
  end
15
-
16
- #Login?
17
- EspressoPath::GeoPath.login
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: espresso_path
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
- - Chris Desch
7
+ - KickinEspresso
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-18 00:00:00.000000000 Z
11
+ date: 2018-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
@@ -29,6 +29,9 @@ dependencies:
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.2'
34
+ - - ">="
32
35
  - !ruby/object:Gem::Version
33
36
  version: 2.2.1
34
37
  type: :development
@@ -36,6 +39,9 @@ dependencies:
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
41
  - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '2.2'
44
+ - - ">="
39
45
  - !ruby/object:Gem::Version
40
46
  version: 2.2.1
41
47
  - !ruby/object:Gem::Dependency
@@ -80,6 +86,34 @@ dependencies:
80
86
  - - "~>"
81
87
  - !ruby/object:Gem::Version
82
88
  version: '3.0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: simplecov
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: 0.15.1
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: 0.15.1
103
+ - !ruby/object:Gem::Dependency
104
+ name: rubocop
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: 0.52.1
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: 0.52.1
83
117
  description: Use the GeoPath API via this Ruby Gem
84
118
  email:
85
119
  - chris@kickinespresso.com
@@ -93,17 +127,22 @@ files:
93
127
  - ".idea/modules.xml"
94
128
  - ".rspec"
95
129
  - ".travis.yml"
130
+ - CHANGELOG.md
96
131
  - CODE_OF_CONDUCT.md
132
+ - CONTRIBUTING.md
97
133
  - Gemfile
98
134
  - LICENSE.txt
99
135
  - README.md
136
+ - RELEASING.md
100
137
  - Rakefile
101
138
  - bin/console
102
139
  - bin/setup
103
140
  - espresso_path.gemspec
104
141
  - lib/espresso_path.rb
142
+ - lib/espresso_path/client.rb
105
143
  - lib/espresso_path/configuration.rb
106
144
  - lib/espresso_path/geo_path.rb
145
+ - lib/espresso_path/models/market.rb
107
146
  - lib/espresso_path/version.rb
108
147
  - lib/generators/espresso_path/install_generator.rb
109
148
  - lib/generators/espresso_path/templates/initializer.rb