share_progress 0.1.0
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 +7 -0
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/share_progress/button.rb +124 -0
- data/lib/share_progress/client.rb +31 -0
- data/lib/share_progress/email_variant.rb +17 -0
- data/lib/share_progress/errors.rb +6 -0
- data/lib/share_progress/facebook_variant.rb +17 -0
- data/lib/share_progress/twitter_variant.rb +17 -0
- data/lib/share_progress/utils.rb +20 -0
- data/lib/share_progress/variant.rb +107 -0
- data/lib/share_progress/variant_collection.rb +94 -0
- data/lib/share_progress/variant_parser.rb +24 -0
- data/lib/share_progress/version.rb +3 -0
- data/lib/share_progress.rb +6 -0
- data/share_progress.gemspec +33 -0
- metadata +152 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 33f1a306cea9f7dddb34309332f1c21e8c74362b
|
4
|
+
data.tar.gz: 0fd51832efb835b705b1ca5b20b84e834af6e84f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 913752b8ebbd327b7300621e16a87f73e3c3905b9e49df8205c76709aa86f46fefcaabdd36537fe233186ee9caba51436b843e322346adbd10fa17851b2b7e60
|
7
|
+
data.tar.gz: 6973aca626b2927a057fa6e7b7d93b0240ea4b5cbfa81aac1cef6275bd916f7d6913d7aacf72427bdd265abab660f7a60212ace6eb733067a4416ac9815f4e2c
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Neal Donnelly
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# ShareProgress
|
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/share_progress`. 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 'share_progress'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install share_progress
|
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. Then, run `rake rspec` to run the tests. 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]/share_progress.
|
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/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "share_progress"
|
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,124 @@
|
|
1
|
+
require 'share_progress'
|
2
|
+
require 'share_progress/client'
|
3
|
+
require 'share_progress/utils'
|
4
|
+
require 'share_progress/errors'
|
5
|
+
require 'share_progress/variant_collection'
|
6
|
+
|
7
|
+
module ShareProgress
|
8
|
+
class Button
|
9
|
+
|
10
|
+
attr_accessor :page_url, :page_title, :button_template, :share_button_html, :is_active, :auto_fill, :variants, :advanced_options, :include, :id
|
11
|
+
attr_reader :errors
|
12
|
+
|
13
|
+
class << self
|
14
|
+
|
15
|
+
def create(page_url:, button_template:, **options)
|
16
|
+
created = update(options.merge(page_url: page_url, button_template: button_template))
|
17
|
+
created.nil? ? new({}) : new(created)
|
18
|
+
end
|
19
|
+
|
20
|
+
# this method is used by instance.save and Button.create
|
21
|
+
def update(options={})
|
22
|
+
Utils.filter_keys(options, allowed_keys)
|
23
|
+
Utils.filter_keys(options[:advanced_options], advanced_options_keys)
|
24
|
+
created = Client.post endpoint('update'), { body: options }
|
25
|
+
created[0] # the API returns a list of length 1
|
26
|
+
end
|
27
|
+
|
28
|
+
def find(id)
|
29
|
+
matches = Client.get endpoint('read'), { query: { id: id } }
|
30
|
+
raise RecordNotFound.new("No button exists with id #{id}") if matches.size < 1
|
31
|
+
new(matches[0])
|
32
|
+
end
|
33
|
+
|
34
|
+
def destroy(id)
|
35
|
+
deleted = Client.post endpoint('delete'), { query: { id: id } }
|
36
|
+
(deleted.size > 0)
|
37
|
+
end
|
38
|
+
|
39
|
+
def all(limit: 100, offset: 0)
|
40
|
+
matches = Client.get endpoint, { query: { limit: limit, offset: offset } }
|
41
|
+
matches.map{ |match| new(match) }
|
42
|
+
end
|
43
|
+
|
44
|
+
def allowed_keys
|
45
|
+
optional_keys + required_keys
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def endpoint(method=nil)
|
51
|
+
extension = method.nil? ? "" : "/#{method}"
|
52
|
+
"/buttons#{extension}"
|
53
|
+
end
|
54
|
+
|
55
|
+
# currently no validation, but worth noting that they're different
|
56
|
+
def required_keys
|
57
|
+
[:page_url, :button_template]
|
58
|
+
end
|
59
|
+
|
60
|
+
def optional_keys
|
61
|
+
[:id, :page_title, :auto_fill, :variants, :advanced_options, :share_button_html, :is_active, :errors]
|
62
|
+
end
|
63
|
+
|
64
|
+
def advanced_options_keys
|
65
|
+
[:automatic_traffic_routing, :buttons_optimize_actions, :custom_params, :prompt]
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def initialize(params)
|
70
|
+
@variant_collection = VariantCollection.new
|
71
|
+
update_attributes(params)
|
72
|
+
end
|
73
|
+
|
74
|
+
def update_attributes(params)
|
75
|
+
params = Utils.symbolize_keys(params)
|
76
|
+
params.each_pair do |key, value|
|
77
|
+
instance_variable_set("@#{key}", value) unless key == :variants
|
78
|
+
end
|
79
|
+
self.variants = params[:variants] if params.include? :variants
|
80
|
+
end
|
81
|
+
|
82
|
+
def save
|
83
|
+
result = self.class.update(serialize)
|
84
|
+
update_attributes(result)
|
85
|
+
(errors.size == 0)
|
86
|
+
end
|
87
|
+
|
88
|
+
def variants=(variants)
|
89
|
+
@variant_collection.update_variants(variants)
|
90
|
+
end
|
91
|
+
|
92
|
+
def variants
|
93
|
+
@variant_collection.serialize
|
94
|
+
end
|
95
|
+
|
96
|
+
def add_or_update_variant(variant)
|
97
|
+
@variant_collection.add_or_update(variant)
|
98
|
+
end
|
99
|
+
|
100
|
+
def remove_variant(variant)
|
101
|
+
@variant_collection.remove(variant)
|
102
|
+
end
|
103
|
+
|
104
|
+
def find_variant(variant)
|
105
|
+
@variant_collection.find(variant)
|
106
|
+
end
|
107
|
+
|
108
|
+
def destroy
|
109
|
+
self.class.destroy(id) ? self : false
|
110
|
+
end
|
111
|
+
|
112
|
+
private
|
113
|
+
|
114
|
+
def serialize
|
115
|
+
serialized = Hash.new
|
116
|
+
self.class.allowed_keys.each do |key|
|
117
|
+
value = send(key)
|
118
|
+
serialized[key] = value unless value.nil?
|
119
|
+
end
|
120
|
+
serialized
|
121
|
+
end
|
122
|
+
|
123
|
+
end
|
124
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
|
3
|
+
module ShareProgress
|
4
|
+
class Client
|
5
|
+
include HTTParty
|
6
|
+
|
7
|
+
base_uri 'run.shareprogress.org/api/v1'
|
8
|
+
default_params key: ENV['SHARE_PROGRESS_API_KEY']
|
9
|
+
|
10
|
+
class << self
|
11
|
+
|
12
|
+
def get(*args)
|
13
|
+
format_response(super(*args))
|
14
|
+
end
|
15
|
+
|
16
|
+
def post(*args)
|
17
|
+
format_response(super(*args))
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def format_response(http_response)
|
23
|
+
formatted = http_response['response'].nil? ? [] : http_response['response']
|
24
|
+
errors = http_response['success'] ? {} : http_response['message']
|
25
|
+
formatted.each { |r| r['errors'] = errors }
|
26
|
+
formatted
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'share_progress'
|
2
|
+
require 'share_progress/variant'
|
3
|
+
|
4
|
+
module ShareProgress
|
5
|
+
class EmailVariant < Variant
|
6
|
+
|
7
|
+
def self.type
|
8
|
+
'email'
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.fields
|
12
|
+
[:email_subject, :email_body]
|
13
|
+
end
|
14
|
+
|
15
|
+
attr_accessor *fields
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'share_progress'
|
2
|
+
require 'share_progress/variant'
|
3
|
+
|
4
|
+
module ShareProgress
|
5
|
+
class FacebookVariant < Variant
|
6
|
+
|
7
|
+
def self.type
|
8
|
+
'facebook'
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.fields
|
12
|
+
[:facebook_title, :facebook_description, :facebook_thumbnail]
|
13
|
+
end
|
14
|
+
|
15
|
+
attr_accessor *fields
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
|
3
|
+
module ShareProgress
|
4
|
+
class Utils
|
5
|
+
class << self
|
6
|
+
|
7
|
+
def filter_keys(params, acceptable)
|
8
|
+
return params if params.nil?
|
9
|
+
params.select!{ |key, _| acceptable.include? key }
|
10
|
+
end
|
11
|
+
|
12
|
+
def symbolize_keys(params)
|
13
|
+
fresh = Hash.new
|
14
|
+
params.each_pair{ |k, v| fresh[k.to_sym] = v }
|
15
|
+
fresh
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
require 'share_progress'
|
2
|
+
require 'share_progress/client'
|
3
|
+
require 'share_progress/errors'
|
4
|
+
require 'share_progress/button'
|
5
|
+
|
6
|
+
module ShareProgress
|
7
|
+
class Variant
|
8
|
+
attr_accessor :button, :id
|
9
|
+
attr_reader :errors, :_destroy
|
10
|
+
|
11
|
+
def initialize(params=nil)
|
12
|
+
update_attributes(params) unless params.nil?
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_s
|
16
|
+
self.serialize.to_json
|
17
|
+
end
|
18
|
+
|
19
|
+
def save
|
20
|
+
add_error('button', "can't be blank") and return false if @button.nil?
|
21
|
+
add_error('button', "must have an id") and return false if @button.id.nil?
|
22
|
+
response = Button.update(id: @button.id, variants: {type => [serialize]})
|
23
|
+
return false unless response.is_a? Hash
|
24
|
+
|
25
|
+
@errors = parse_errors(response['errors'])
|
26
|
+
(@errors.size == 0)
|
27
|
+
end
|
28
|
+
|
29
|
+
def destroy
|
30
|
+
add_error('id', "can't be blank") and return false if id.nil?
|
31
|
+
@_destroy = true
|
32
|
+
saved = save
|
33
|
+
@_destroy = nil
|
34
|
+
saved ? self : false
|
35
|
+
end
|
36
|
+
|
37
|
+
def serialize
|
38
|
+
serialized = Hash.new
|
39
|
+
all_fields.each do |field|
|
40
|
+
value = send(field)
|
41
|
+
serialized[field] = value unless (value.nil? and field == :_destroy)
|
42
|
+
end
|
43
|
+
serialized
|
44
|
+
end
|
45
|
+
|
46
|
+
def update_attributes(params)
|
47
|
+
if params.is_a? Variant
|
48
|
+
params.instance_variables.each do |key|
|
49
|
+
instance_variable_set(key, params.instance_variable_get(key))
|
50
|
+
end
|
51
|
+
elsif params.is_a? Hash
|
52
|
+
Utils.symbolize_keys(params).each_pair do |key, value|
|
53
|
+
@button = value if key == :button
|
54
|
+
instance_variable_set("@#{key}", value) if all_fields.include? key
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def all_fields
|
60
|
+
self.class.fields + [:id, :_destroy]
|
61
|
+
end
|
62
|
+
|
63
|
+
def type
|
64
|
+
self.class.type
|
65
|
+
end
|
66
|
+
|
67
|
+
def set_analytics(analytics:)
|
68
|
+
# Thinking at the moment that it makes sense to keep this as a basic hash, though
|
69
|
+
# we might need to extend its functionality down the road.
|
70
|
+
@analytics = analytics
|
71
|
+
end
|
72
|
+
|
73
|
+
def analytics
|
74
|
+
if @analytics
|
75
|
+
@analytics
|
76
|
+
else
|
77
|
+
raise AnalyticsNotFound
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
private
|
82
|
+
|
83
|
+
def add_error(field, message)
|
84
|
+
@errors ||= {}
|
85
|
+
@errors[field.to_s] ||= []
|
86
|
+
@errors[field.to_s].push(message)
|
87
|
+
end
|
88
|
+
|
89
|
+
def parse_errors(errors)
|
90
|
+
begin
|
91
|
+
messages = errors['variants'][0]
|
92
|
+
return {} if messages.nil?
|
93
|
+
rescue NoMethodError, KeyError, IndexError
|
94
|
+
return {}
|
95
|
+
end
|
96
|
+
# it concatenates the field and the error into a full message
|
97
|
+
output = {}
|
98
|
+
messages.map{|msg| msg.split(' ', 2)}.each do |field, error|
|
99
|
+
output[field] ||= []
|
100
|
+
output[field].push error
|
101
|
+
end
|
102
|
+
output
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require 'share_progress/variant'
|
2
|
+
require 'share_progress/variant_parser'
|
3
|
+
|
4
|
+
module ShareProgress
|
5
|
+
class VariantCollection
|
6
|
+
|
7
|
+
def initialize(variants_hash=nil)
|
8
|
+
@variants = []
|
9
|
+
update_variants(variants_hash) unless variants_hash.nil?
|
10
|
+
end
|
11
|
+
|
12
|
+
def update_variants(variants_hash)
|
13
|
+
survivors = []
|
14
|
+
variants_hash.each_pair do |variant_type, variants_list|
|
15
|
+
variants_list.each do |variant_hash|
|
16
|
+
added = add_or_update(variant_hash)
|
17
|
+
survivors.push(added)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
@variants.select!{ |v| survivors.include? v }
|
21
|
+
end
|
22
|
+
|
23
|
+
def serialize
|
24
|
+
serialized = {}
|
25
|
+
@variants.each do |variant_obj|
|
26
|
+
type_name = variant_obj.type.to_sym
|
27
|
+
serialized[type_name] ||= []
|
28
|
+
serialized[type_name].push variant_obj.serialize
|
29
|
+
end
|
30
|
+
serialized
|
31
|
+
end
|
32
|
+
|
33
|
+
def add_or_update(variant)
|
34
|
+
variant_obj = find(variant)
|
35
|
+
if variant_obj.nil?
|
36
|
+
if variant.is_a? Variant
|
37
|
+
@variants.push variant
|
38
|
+
variant_obj = variant
|
39
|
+
else
|
40
|
+
variant_obj = create_variant(variant)
|
41
|
+
@variants.push(variant_obj)
|
42
|
+
end
|
43
|
+
else
|
44
|
+
variant_obj.update_attributes(variant)
|
45
|
+
end
|
46
|
+
variant_obj
|
47
|
+
end
|
48
|
+
|
49
|
+
def remove(variant)
|
50
|
+
target = find(variant)
|
51
|
+
destroyed = target.destroy
|
52
|
+
return false if destroyed == false
|
53
|
+
@variants.select!{ |v| v.id != target.id }
|
54
|
+
destroyed
|
55
|
+
end
|
56
|
+
|
57
|
+
def variants
|
58
|
+
@variants
|
59
|
+
end
|
60
|
+
|
61
|
+
def find(mystery_variant)
|
62
|
+
if mystery_variant.is_a? Variant
|
63
|
+
find_variant_by_obj(mystery_variant)
|
64
|
+
elsif mystery_variant.is_a? Hash
|
65
|
+
find_variant_by_id(Utils.symbolize_keys(mystery_variant)[:id])
|
66
|
+
elsif mystery_variant.is_a? Fixnum
|
67
|
+
find_variant_by_id(mystery_variant)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
private
|
72
|
+
|
73
|
+
def create_variant(variant_hash)
|
74
|
+
VariantParser.parse(variant_hash).new(variant_hash)
|
75
|
+
end
|
76
|
+
|
77
|
+
def find_variant_by_obj(variant_obj)
|
78
|
+
matching = @variants.select{ |candidate| candidate == variant_obj}
|
79
|
+
if matching.size > 0
|
80
|
+
matching[0]
|
81
|
+
elsif variant_obj.id
|
82
|
+
find_variant_by_id(variant_obj.id)
|
83
|
+
else
|
84
|
+
nil
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def find_variant_by_id(id)
|
89
|
+
matching = @variants.select{ |candidate| candidate.id == id }
|
90
|
+
matching.size > 0 ? matching[0] : nil
|
91
|
+
end
|
92
|
+
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'share_progress'
|
2
|
+
require 'share_progress/errors'
|
3
|
+
require 'share_progress/email_variant'
|
4
|
+
require 'share_progress/facebook_variant'
|
5
|
+
require 'share_progress/twitter_variant'
|
6
|
+
|
7
|
+
module ShareProgress
|
8
|
+
class VariantParser
|
9
|
+
|
10
|
+
def self.parse(hash_to_parse)
|
11
|
+
keys = hash_to_parse.keys.map(&:to_sym)
|
12
|
+
match = nil
|
13
|
+
[FacebookVariant, EmailVariant, TwitterVariant].each do |variant_class|
|
14
|
+
if (keys & variant_class.fields).size > 0 # & is array intersection
|
15
|
+
raise CouldNotParseVariant unless match.nil? # only match one class
|
16
|
+
match = variant_class
|
17
|
+
end
|
18
|
+
end
|
19
|
+
raise CouldNotParseVariant if match.nil?
|
20
|
+
match
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'share_progress/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'share_progress'
|
8
|
+
spec.version = ShareProgress::VERSION
|
9
|
+
spec.authors = ['Neal Donnelly', 'Eric Boersma']
|
10
|
+
spec.email = ['NealJMD@gmail.com', 'eric.boersma@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = %q{A simple gem designed for creating and retrieving buttons and data on ShareProgress.org}
|
13
|
+
spec.homepage = 'https://github.com/SumOfUs/share_progress'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = 'exe'
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
# ruby version for required named parameters
|
22
|
+
spec.required_ruby_version = '>= 2.1'
|
23
|
+
|
24
|
+
# Development Dependencies
|
25
|
+
spec.add_development_dependency 'bundler'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
+
spec.add_development_dependency 'rspec'
|
28
|
+
spec.add_development_dependency 'webmock'
|
29
|
+
spec.add_development_dependency 'vcr'
|
30
|
+
|
31
|
+
# Runtime Dependencies
|
32
|
+
spec.add_runtime_dependency 'httparty'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: share_progress
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Neal Donnelly
|
8
|
+
- Eric Boersma
|
9
|
+
autorequire:
|
10
|
+
bindir: exe
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '10.0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '10.0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rspec
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: webmock
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: vcr
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: httparty
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :runtime
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
description:
|
99
|
+
email:
|
100
|
+
- NealJMD@gmail.com
|
101
|
+
- eric.boersma@gmail.com
|
102
|
+
executables: []
|
103
|
+
extensions: []
|
104
|
+
extra_rdoc_files: []
|
105
|
+
files:
|
106
|
+
- ".gitignore"
|
107
|
+
- ".rspec"
|
108
|
+
- ".travis.yml"
|
109
|
+
- Gemfile
|
110
|
+
- LICENSE.txt
|
111
|
+
- README.md
|
112
|
+
- Rakefile
|
113
|
+
- bin/console
|
114
|
+
- bin/setup
|
115
|
+
- lib/share_progress.rb
|
116
|
+
- lib/share_progress/button.rb
|
117
|
+
- lib/share_progress/client.rb
|
118
|
+
- lib/share_progress/email_variant.rb
|
119
|
+
- lib/share_progress/errors.rb
|
120
|
+
- lib/share_progress/facebook_variant.rb
|
121
|
+
- lib/share_progress/twitter_variant.rb
|
122
|
+
- lib/share_progress/utils.rb
|
123
|
+
- lib/share_progress/variant.rb
|
124
|
+
- lib/share_progress/variant_collection.rb
|
125
|
+
- lib/share_progress/variant_parser.rb
|
126
|
+
- lib/share_progress/version.rb
|
127
|
+
- share_progress.gemspec
|
128
|
+
homepage: https://github.com/SumOfUs/share_progress
|
129
|
+
licenses:
|
130
|
+
- MIT
|
131
|
+
metadata: {}
|
132
|
+
post_install_message:
|
133
|
+
rdoc_options: []
|
134
|
+
require_paths:
|
135
|
+
- lib
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '2.1'
|
141
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements: []
|
147
|
+
rubyforge_project:
|
148
|
+
rubygems_version: 2.4.3
|
149
|
+
signing_key:
|
150
|
+
specification_version: 4
|
151
|
+
summary: A simple gem designed for creating and retrieving buttons and data on ShareProgress.org
|
152
|
+
test_files: []
|