jackpotrising 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/README.md +41 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/Jackpotrising/client.rb +28 -0
- data/lib/Jackpotrising/configuration.rb +48 -0
- data/lib/Jackpotrising/version.rb +3 -0
- data/lib/jackpotrising.rb +15 -0
- metadata +80 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d9a1981f7c5c266dd73594105d7fa70be14ddf07
|
4
|
+
data.tar.gz: 9542e14632d7968029d7f17e7fafa4d331a56a76
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bfaf4414650068134be3f057e8079b6f95ba21733a945dc3c874b95557f54efc47004088c221d4d00d66c6c79bd9f5ec5138817186a12fdf365a882cf23f769f
|
7
|
+
data.tar.gz: 0b52ab84a67e263f174ce85114d26569253456740e0ead624f348253f06791107c797ac6b04b1d8a5aed09244bc15973512f1f6cea61a2515432998d4a30d9a2
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at nwallace@fyberstudios.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# JackpotRising
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/JackpotRising`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'JackpotRising'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install JackpotRising
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/JackpotRising. 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.
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
+
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "JackpotRising"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
|
3
|
+
module Jackpotrising
|
4
|
+
|
5
|
+
class Client
|
6
|
+
|
7
|
+
ENDPOINT_URL = "http://api-staging.jackpotrising.com"
|
8
|
+
|
9
|
+
def initialize()
|
10
|
+
end
|
11
|
+
|
12
|
+
def login(email, password)
|
13
|
+
data = { "email": email, "password": password }
|
14
|
+
uri = URI("#{ENDPOINT_URL}/users/login/email")
|
15
|
+
|
16
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
17
|
+
|
18
|
+
request = Net::HTTP::Post.new(uri.path, {'Content-Type' =>'application/json'})
|
19
|
+
request.body = data.to_json
|
20
|
+
|
21
|
+
response = http.request(request)
|
22
|
+
Rails.logger.debug response
|
23
|
+
return response
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Jackpotrising
|
2
|
+
module Configuration
|
3
|
+
VALID_CONNECTION_KEYS = [:endpoint, :method, :user_agent, :url].freeze
|
4
|
+
VALID_OPTIONS_KEYS = [:params, :api_key, :format].freeze
|
5
|
+
VALID_CONFIG_KEYS = VALID_CONNECTION_KEYS + VALID_OPTIONS_KEYS
|
6
|
+
|
7
|
+
DEFAULT_ENDPOINT = "http://api-staging.jackpotrising.com"
|
8
|
+
DEFAULT_METHOD = :get
|
9
|
+
DEFAULT_USER_AGENT = "Jackpot Rising API Ruby Gem #{Jackpotrising::VERSION}".freeze
|
10
|
+
|
11
|
+
DEFAULT_API_KEY = nil
|
12
|
+
DEFAULT_FORMAT = :json
|
13
|
+
DEFAULT_URL = nil
|
14
|
+
|
15
|
+
# Build accessor methods for every config options so we can do this, for example:
|
16
|
+
# Awesome.format = :xml
|
17
|
+
attr_accessor *VALID_CONFIG_KEYS
|
18
|
+
|
19
|
+
# Make sure we have the default values set when we get 'extended'
|
20
|
+
def self.extended(base)
|
21
|
+
base.reset
|
22
|
+
end
|
23
|
+
|
24
|
+
def reset
|
25
|
+
self.endpoint = DEFAULT_ENDPOINT
|
26
|
+
self.method = DEFAULT_METHOD
|
27
|
+
self.user_agent = DEFAULT_USER_AGENT
|
28
|
+
self.url = DEFAULT_URL
|
29
|
+
|
30
|
+
self.api_key = DEFAULT_API_KEY
|
31
|
+
self.format = DEFAULT_FORMAT
|
32
|
+
end
|
33
|
+
|
34
|
+
def configure(url, method)
|
35
|
+
self.url = url
|
36
|
+
self.endpoint = DEFAULT_ENDPOINT + url
|
37
|
+
self.method = method
|
38
|
+
|
39
|
+
yield self
|
40
|
+
end
|
41
|
+
|
42
|
+
# Return the configuration values set in this module
|
43
|
+
def options
|
44
|
+
Hash[ * VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ]
|
45
|
+
end
|
46
|
+
|
47
|
+
end # Configuration
|
48
|
+
end
|
metadata
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jackpotrising
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.18
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nick Wallace
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-06-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.12'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.12'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: Jackpot Rising Ruby Gem for using in your ruby game
|
42
|
+
email:
|
43
|
+
- developer@jackpotrising.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- lib/Jackpotrising/client.rb
|
49
|
+
- lib/Jackpotrising/configuration.rb
|
50
|
+
- lib/Jackpotrising/version.rb
|
51
|
+
- lib/jackpotrising.rb
|
52
|
+
- bin/console
|
53
|
+
- bin/setup
|
54
|
+
- CODE_OF_CONDUCT.md
|
55
|
+
- README.md
|
56
|
+
homepage: https://www.jackpotrising.com
|
57
|
+
licenses:
|
58
|
+
- MIT
|
59
|
+
metadata: {}
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.2.4
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
requirements: []
|
75
|
+
rubyforge_project:
|
76
|
+
rubygems_version: 2.0.14.1
|
77
|
+
signing_key:
|
78
|
+
specification_version: 4
|
79
|
+
summary: Jackpot Rising Ruby Gem
|
80
|
+
test_files: []
|