snowshoe_ruby 0.0.1.alpha

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 35f5fa1401f5bcc897aaaabc33aeafee618f897c
4
+ data.tar.gz: 8016bdbf66329b3b10828483e7d796f821fb08b3
5
+ SHA512:
6
+ metadata.gz: ec2759ee9eda655e9c5a777b16d4e57484cda1a87f45232cdcc5f22ea61308b57fe6891527ff9097ed6c5a1dfce70769784098b7adb821edab8c7ab50c1a94ae
7
+ data.tar.gz: b59163b7641f8c4584ee6d872a72a8999bd767d47df5f8d5e34e912e6b2cb3676b5c93ff355df25fa98ffe08556709c2274a428bc45cca60b999c87416f39c9c
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in snowshoe_ruby.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 IggyIgner
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # SnowshoeRuby
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'snowshoe_ruby'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install snowshoe_ruby
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/snowshoe_ruby/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.libs << 'test'
6
+ end
7
+
8
+ desc "Run tests"
9
+ task :default => :test
@@ -0,0 +1,18 @@
1
+ class Client
2
+ attr_reader :app_key, :app_secret
3
+
4
+ def initialize(app_key, app_secret)
5
+ @base_url = "http://beta.snowshoestamp.com/api/v2/"
6
+ # Instance variables
7
+ @app_key = app_key
8
+ @app_secret = app_secret
9
+ end
10
+
11
+ def self.app_key
12
+ @app_key
13
+ end
14
+
15
+ def self.app_secret
16
+ @app_secret
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ module SnowshoeRuby
2
+ VERSION = "0.0.1.alpha"
3
+ end
@@ -0,0 +1,21 @@
1
+ require "snowshoe_ruby/version"
2
+ require "snowshoe_ruby/client"
3
+
4
+ module SnowshoeRuby
5
+ #client = Client.new('5bc9c3ddf1f46265e03a', '70a99aa7f4de7f48f235215ce2708b6e4f19377c')
6
+
7
+ @callback_url = "http://10.99.114.161/:3000/stamp_info"
8
+ @data = {"data" => params["data"]}
9
+
10
+ @consumer = OAuth::Consumer.new(
11
+ client.app_key,
12
+ client.app_secret,
13
+ {:site => "http://beta.snowshoestamp.com/api",
14
+ :scheme => :header
15
+ })
16
+ # Get Auth key with consumer
17
+ @resp = @consumer.request(:post, '/v2/stamp', nil, {}, @data, { 'Content-Type' => 'application/x-www-form-urlencoded' })
18
+
19
+ # Parse response and send to template
20
+ @response = JSON.parse(@resp.body)
21
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'snowshoe_ruby/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "snowshoe_ruby"
8
+ spec.version = SnowshoeRuby::VERSION
9
+ spec.authors = ["IggyIgner", "dotfury"]
10
+ spec.email = ["jonathan.igner@gmail.com"]
11
+ spec.summary = %q{Ruby SDK for SnowShoe}
12
+ spec.description = %q{SDK allowing developers to easily integrate SnowShoe stamps into their app.}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.add_runtime_dependency "oauth", ["= 0.4.7"]
17
+
18
+ spec.files = `git ls-files -z`.split("\x0")
19
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.6"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
@@ -0,0 +1,14 @@
1
+ require 'test/unit'
2
+ require 'snowshoe_ruby/client'
3
+
4
+ class SnowshoeRubyTest < Test::Unit::TestCase
5
+ def test_app_key
6
+ client = Client.new('5bc9c3ddf1f46265e03a', '70a99aa7f4de7f48f235215ce2708b6e4f19377c')
7
+ assert_equal "5bc9c3ddf1f46265e03a", client.app_key
8
+ end
9
+
10
+ def test_app_secret
11
+ client = Client.new('5bc9c3ddf1f46265e03a', '70a99aa7f4de7f48f235215ce2708b6e4f19377c')
12
+ assert_equal "70a99aa7f4de7f48f235215ce2708b6e4f19377c", client.app_secret
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: snowshoe_ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.alpha
5
+ platform: ruby
6
+ authors:
7
+ - IggyIgner
8
+ - dotfury
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-08-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: oauth
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '='
19
+ - !ruby/object:Gem::Version
20
+ version: 0.4.7
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '='
26
+ - !ruby/object:Gem::Version
27
+ version: 0.4.7
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.6'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.6'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '10.0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '10.0'
56
+ description: SDK allowing developers to easily integrate SnowShoe stamps into their
57
+ app.
58
+ email:
59
+ - jonathan.igner@gmail.com
60
+ executables: []
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - ".gitignore"
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - lib/snowshoe_ruby.rb
70
+ - lib/snowshoe_ruby/client.rb
71
+ - lib/snowshoe_ruby/version.rb
72
+ - snowshoe_ruby.gemspec
73
+ - test/test_snowshoe_ruby.rb
74
+ homepage: ''
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">"
90
+ - !ruby/object:Gem::Version
91
+ version: 1.3.1
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.0.14
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Ruby SDK for SnowShoe
98
+ test_files:
99
+ - test/test_snowshoe_ruby.rb