ratsit 0.0.1
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 +12 -0
- data/CODE_OF_CONDUCT.md +0 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +7 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/ratsit.rb +82 -0
- data/lib/ratsit/errors.rb +10 -0
- data/lib/ratsit/filters.rb +155 -0
- data/lib/ratsit/monkey.rb +10 -0
- data/lib/ratsit/package.rb +22 -0
- data/lib/ratsit/person.rb +39 -0
- data/lib/ratsit/request.rb +80 -0
- data/lib/ratsit/search_type.rb +19 -0
- data/lib/ratsit/version.rb +3 -0
- data/ratsit.gemspec +35 -0
- metadata +119 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8fe41a466ccf397de54bac8fb52e76f96ada4bac
|
4
|
+
data.tar.gz: c81222eb134bd582d1c5b708dff6bfddc14b03c6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e33317326a6c442affc955fc4dda650e43495b205ff22e394ea487d71ac47598c0e5584d8bede38a6531a14d71cc34eb580d662ccdc340eab3289fcaf0adf3d0
|
7
|
+
data.tar.gz: f15ac274848fe9da25ebceccca9c472ed1be104fabe49658c03edf4ebf0c6ff886f55de5fc6c185cfb3a482586095a39901cd4d7bf20c6d86c1f9b23221562eb
|
data/.gitignore
ADDED
data/CODE_OF_CONDUCT.md
ADDED
File without changes
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Stefan Nyman
|
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
|
+
# Ratsit
|
2
|
+
|
3
|
+
Ruby gem for performing Ratsit searches.
|
4
|
+
|
5
|
+
_Note_: This gem is under active development and might not be suitable for use yet...
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'ratsit'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install ratsit
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Coming...
|
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/qoorp/ratsit.
|
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 "ratsit"
|
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
data/lib/ratsit.rb
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'ratsit/version'
|
2
|
+
require 'ratsit/package'
|
3
|
+
require 'ratsit/search_type'
|
4
|
+
require 'ratsit/request'
|
5
|
+
require 'ratsit/filters'
|
6
|
+
require 'ratsit/errors'
|
7
|
+
require 'json'
|
8
|
+
|
9
|
+
module Ratsit
|
10
|
+
|
11
|
+
api_key_key = 'RATSIT_API_KEY'
|
12
|
+
@env_api_key = ENV[api_key_key]
|
13
|
+
if @env_api_key.nil?
|
14
|
+
puts "No api key specified. The library can only search using the open api. Set your api key using key #{api_key_key}"
|
15
|
+
end
|
16
|
+
|
17
|
+
class RatsitSearch
|
18
|
+
|
19
|
+
attr_reader :filter
|
20
|
+
attr_reader :results
|
21
|
+
|
22
|
+
def initialize(search_type, filter_instance)
|
23
|
+
@filter = filter_instance
|
24
|
+
@search_type = search_type
|
25
|
+
@results = nil
|
26
|
+
@api_key = @env_api_key
|
27
|
+
end
|
28
|
+
|
29
|
+
def search(search_arg, search_area='')
|
30
|
+
if !search_arg.is_a?(String)
|
31
|
+
raise RatsitError, 'Invalid search argument'
|
32
|
+
end
|
33
|
+
if search_arg.length == 0
|
34
|
+
raise RatsitError, 'Invalid search argument length'
|
35
|
+
end
|
36
|
+
if !search_area.is_a?(String)
|
37
|
+
raise RatsitError, 'Invalid search area'
|
38
|
+
end
|
39
|
+
request_class = (!@api_key.nil?)? Ratsit::RatsitTokenRequest: Ratsit::RatsitOpenRequest
|
40
|
+
@request = request_class.new(search_arg, search_area, @search_type, @filter)
|
41
|
+
@request.exec()
|
42
|
+
# check this...
|
43
|
+
if @request.response_ok
|
44
|
+
#puts "response ok"
|
45
|
+
#@results = @request.response_body.to_json
|
46
|
+
@results = @request.response_body
|
47
|
+
else
|
48
|
+
@results = nil
|
49
|
+
end
|
50
|
+
@results
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
class PersonSearch < RatsitSearch
|
56
|
+
|
57
|
+
def initialize()
|
58
|
+
super(Ratsit::SEARCH_TYPE_PERSON, Ratsit::PersonFilter.new())
|
59
|
+
self
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
class CompanySearch < RatsitSearch
|
65
|
+
|
66
|
+
def initialize()
|
67
|
+
super(Ratsit::SEARCH_TYPE_COMPANY, Ratsit::CompanyFilter.new())
|
68
|
+
self
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
class EstateSearch < RatsitSearch
|
74
|
+
|
75
|
+
def initialize()
|
76
|
+
super(Ratsit::SEARCH_TYPE_ESTATE, Ratsit::EstateFilter.new())
|
77
|
+
self
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
@@ -0,0 +1,155 @@
|
|
1
|
+
|
2
|
+
require 'ratsit/errors'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module Ratsit
|
6
|
+
|
7
|
+
# Person filters
|
8
|
+
FILTER_MARRIED = 'Married'
|
9
|
+
FILTER_UNMARRIED = 'Unmarried'
|
10
|
+
FILTER_MALE = 'Male'
|
11
|
+
FILTER_FEMALE = 'Female'
|
12
|
+
FILTER_COMPANY_ENGAGEMENT = 'CompanyEngagement'
|
13
|
+
FILTER_NO_COMPANY_ENGAGEMENT = 'NoCompanyEngagement'
|
14
|
+
FILTER_AGE_FROM = 'AgeFrom'
|
15
|
+
FILTER_AGE_TO = 'AgeTo'
|
16
|
+
|
17
|
+
# Company filters
|
18
|
+
FILTER_AB = 'AB'
|
19
|
+
FILTER_EF = 'EF'
|
20
|
+
FILTER_HB = 'HB'
|
21
|
+
FILTER_OTHER = 'Other'
|
22
|
+
|
23
|
+
|
24
|
+
class RatsitFilter
|
25
|
+
|
26
|
+
def initialize()
|
27
|
+
@active_filters = {}
|
28
|
+
@filter_defaults = {}
|
29
|
+
end
|
30
|
+
|
31
|
+
def active_filters
|
32
|
+
return (@active_filters.nil?)? nil: @active_filters
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_json
|
36
|
+
af = self.active_filters
|
37
|
+
return '{}' if af.nil?
|
38
|
+
af.to_json
|
39
|
+
end
|
40
|
+
|
41
|
+
def update(filter_key='', filter_value)
|
42
|
+
#puts "update #{filter_key}: #{filter_value}"
|
43
|
+
if !filter_key.is_a?(String)
|
44
|
+
raise RatsitFilterError, 'Invalid filter key'
|
45
|
+
end
|
46
|
+
if filter_value.nil?
|
47
|
+
raise RatsitFilterError, 'Invalid filter value'
|
48
|
+
end
|
49
|
+
if !@active_filters.has_key?(filter_key)
|
50
|
+
raise RatsitFilterError, 'Non-existent filter key'
|
51
|
+
end
|
52
|
+
@curr_filters = Marshal.load(Marshal.dump(@active_filters))
|
53
|
+
@curr_filters[filter_key] = filter_value
|
54
|
+
@active_filters = validate_filters(@filter_defaults, @curr_filters)
|
55
|
+
end
|
56
|
+
|
57
|
+
def reset(filter_name='')
|
58
|
+
if !filter_name.is_a?(String)
|
59
|
+
raise RatsitFilterError, 'Invalid filter key'
|
60
|
+
end
|
61
|
+
if !@filter_defaults.has_key?(filter_name)
|
62
|
+
raise RatsitFilterError, 'Non-existent filter key'
|
63
|
+
end
|
64
|
+
@active_filters[filter_name] = @filter_defaults[filter_name][:default]
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
class PersonFilter < RatsitFilter
|
70
|
+
include Ratsit
|
71
|
+
#{"Married":true,"Unmarried":true,"Male":true,"Female":true,"CompanyEngagement":true,"NoCompanyEngagement":true,"AgeFrom":"0","AgeTo":"150"}
|
72
|
+
def initialize(filters={})
|
73
|
+
super()
|
74
|
+
@filter_defaults = {
|
75
|
+
FILTER_MARRIED => {:parse => method(:parse_bool), :default => true},
|
76
|
+
FILTER_UNMARRIED => {:parse => method(:parse_bool), :default => true},
|
77
|
+
FILTER_MALE => {:parse => method(:parse_bool), :default => true},
|
78
|
+
FILTER_FEMALE => {:parse => method(:parse_bool), :default => true},
|
79
|
+
FILTER_COMPANY_ENGAGEMENT => {:parse => method(:parse_bool), :default => true},
|
80
|
+
FILTER_NO_COMPANY_ENGAGEMENT => {:parse => method(:parse_bool), :default => true},
|
81
|
+
FILTER_AGE_FROM => {:parse => method(:parse_age), :default => '0'},
|
82
|
+
FILTER_AGE_TO => {:parse => method(:parse_age), :default => '150'}
|
83
|
+
}
|
84
|
+
@active_filters = validate_filters(@filter_defaults, filters)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
class CompanyFilter < RatsitFilter
|
89
|
+
include Ratsit
|
90
|
+
#{"AB":true,"EF":true,"HB":true,"Other":true}
|
91
|
+
def initialize(filters={})
|
92
|
+
super()
|
93
|
+
@filter_defaults = {
|
94
|
+
FILTER_AB => {:parse => method(:parse_bool), :default => true},
|
95
|
+
FILTER_EF => {:parse => method(:parse_bool), :default => true},
|
96
|
+
FILTER_HB => {:parse => method(:parse_bool), :default => true},
|
97
|
+
FILTER_OTHER => {:parse => method(:parse_bool), :default => true}
|
98
|
+
}
|
99
|
+
@active_filters = validate_filters(@filter_defaults, filters)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
class EstateFilter < RatsitFilter
|
104
|
+
include Ratsit
|
105
|
+
def initialize()
|
106
|
+
raise NotImplementedError, 'Functionality doesn\'t exist'
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
private
|
111
|
+
|
112
|
+
def parse_bool(arg)
|
113
|
+
return arg if arg.is_a?(TrueClass) || arg.is_a?(FalseClass)
|
114
|
+
raise RatsitFilterError, 'Invalid bool representation' if !arg.is_a?(String)
|
115
|
+
return true if arg.downcase == 'true'
|
116
|
+
return false if arg.downcase == 'false'
|
117
|
+
raise RatsitFilterError, 'Invalid textual bool value'
|
118
|
+
end
|
119
|
+
|
120
|
+
def parse_age(arg)
|
121
|
+
if arg.is_a?(String)
|
122
|
+
if !(arg =~ /^[0-9]+$/)
|
123
|
+
raise RatsitFilterError, 'Invalid age in filter'
|
124
|
+
end
|
125
|
+
larg = arg.to_i
|
126
|
+
elsif arg.is_a?(Integer)
|
127
|
+
larg = arg
|
128
|
+
else
|
129
|
+
raise RatsitFilterError, 'Invalid arg type in filter'
|
130
|
+
end
|
131
|
+
# ratsit specifies these ages.
|
132
|
+
if larg < 0 || larg > 150
|
133
|
+
raise RatsitFilterError, 'Invalid age'
|
134
|
+
end
|
135
|
+
return "#{larg}"
|
136
|
+
end
|
137
|
+
|
138
|
+
def validate_filters(filter_defaults={}, filters={})
|
139
|
+
if !filters.is_a?(Hash)
|
140
|
+
filters = {}
|
141
|
+
end
|
142
|
+
filters.reject! { |k,_| !filter_defaults.keys.include? k }
|
143
|
+
filter_defaults.each do |filter_name, defs|
|
144
|
+
if !filters.keys.include? filter_name
|
145
|
+
filters[filter_name] = defs[:default]
|
146
|
+
end
|
147
|
+
filters[filter_name] = defs[:parse].call(filters[filter_name])
|
148
|
+
end
|
149
|
+
if filters[FILTER_AGE_TO].to_i < filters[FILTER_AGE_FROM].to_i
|
150
|
+
raise RatsitFilterError, 'Invalid age span'
|
151
|
+
end
|
152
|
+
return filters
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
module Ratsit
|
3
|
+
PACKAGE_SMALL_1 = 'small 1'
|
4
|
+
PACKAGE_SMALL_2 = 'small 2'
|
5
|
+
PACKAGE_SMALL_3 = 'small 3'
|
6
|
+
PACKAGE_REMARK = 'anmarkning'
|
7
|
+
PACKAGE_MEDIUM = 'medium'
|
8
|
+
PACKAGE_LARGE = 'large'
|
9
|
+
|
10
|
+
def Ratsit.validate_package(package)
|
11
|
+
raise RatsitError, 'Invalid package argument type' if !package.is_a?(String)
|
12
|
+
return [
|
13
|
+
PACKAGE_SMALL_1,
|
14
|
+
PACKAGE_SMALL_2,
|
15
|
+
PACKAGE_SMALL_3,
|
16
|
+
PACKAGE_REMARK,
|
17
|
+
PACKAGE_MEDIUM,
|
18
|
+
PACKAGE_LARGE
|
19
|
+
].include?(package)
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
require 'ratsit/monkey'
|
3
|
+
require 'ratsit/errors'
|
4
|
+
|
5
|
+
module Ratsit
|
6
|
+
|
7
|
+
class Person
|
8
|
+
|
9
|
+
def initialize(json_obj)
|
10
|
+
if !json_obj.is_a?(Hash)
|
11
|
+
raise RatsitError, 'Invalid Person initializer'
|
12
|
+
end
|
13
|
+
@json_source = json_obj
|
14
|
+
json_obj.each do |k, v|
|
15
|
+
case k
|
16
|
+
when 'FirstName'
|
17
|
+
v.gsub!("<b>", "")
|
18
|
+
v.gsub!("</b>", "")
|
19
|
+
when 'Gender'
|
20
|
+
v = v.gsub("icon_", "")
|
21
|
+
v = v.gsub(".png", "")
|
22
|
+
when 'Married'
|
23
|
+
v = v.gsub("icon_", "")
|
24
|
+
v = v.gsub(".png", "")
|
25
|
+
when 'CompanyEngagement'
|
26
|
+
v = v.gsub("icon_", "")
|
27
|
+
v = v.gsub(".png", "")
|
28
|
+
else
|
29
|
+
v = v
|
30
|
+
end
|
31
|
+
self.class.send(:define_method, k.underscore) {
|
32
|
+
return v
|
33
|
+
}
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
|
2
|
+
require 'faraday'
|
3
|
+
require 'uri'
|
4
|
+
require 'json'
|
5
|
+
require 'ratsit/errors'
|
6
|
+
require 'ratsit/filters'
|
7
|
+
require 'ratsit/search_type'
|
8
|
+
|
9
|
+
module Ratsit
|
10
|
+
|
11
|
+
class RatsitRequest
|
12
|
+
|
13
|
+
def initialize()
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
def exec()
|
18
|
+
uri = self.build_uri
|
19
|
+
conn = Faraday.new(:url => "http://#{uri.host}")
|
20
|
+
#puts "http://#{uri.host}"
|
21
|
+
#puts self.compose_request_body
|
22
|
+
@response = conn.post do |req|
|
23
|
+
req.url uri.request_uri
|
24
|
+
req.headers['Content-Type'] = 'application/json'
|
25
|
+
req.body = self.compose_request_body
|
26
|
+
end
|
27
|
+
#puts @response.body
|
28
|
+
#puts @response.status
|
29
|
+
end
|
30
|
+
|
31
|
+
def response_ok
|
32
|
+
return false if @response.nil?
|
33
|
+
return @response.status == 200
|
34
|
+
end
|
35
|
+
|
36
|
+
def response_body
|
37
|
+
return nil if @response.nil?
|
38
|
+
return @response.body
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class RatsitOpenRequest < RatsitRequest
|
43
|
+
|
44
|
+
def initialize(search_term, search_area, search_type, filters)
|
45
|
+
super()
|
46
|
+
if search_type == Ratsit::SEARCH_TYPE_ESTATE
|
47
|
+
raise RatsitRequestError, 'Estate search is not available in open api'
|
48
|
+
end
|
49
|
+
@base_url = 'http://www.ratsit.se/BC/SearchSimple.aspx/'
|
50
|
+
@search_term = search_term
|
51
|
+
@search_area = search_area
|
52
|
+
@search_type = search_type
|
53
|
+
@search_filter = filters
|
54
|
+
self
|
55
|
+
end
|
56
|
+
|
57
|
+
def build_uri
|
58
|
+
if !Ratsit.validate_search_type(@search_type)
|
59
|
+
raise RatsitRequestError, 'Invalid search type'
|
60
|
+
end
|
61
|
+
URI.parse("#{@base_url}#{@search_type}")
|
62
|
+
end
|
63
|
+
|
64
|
+
def compose_request_body
|
65
|
+
{
|
66
|
+
'who': @search_term,
|
67
|
+
'where': @search_area,
|
68
|
+
'filter': @search_filter.to_json
|
69
|
+
}.to_json
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
class RatsitTokenRequest < RatsitRequest
|
75
|
+
def initialize()
|
76
|
+
raise NotImplementedError, 'Token requests are not supported yet'
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
require 'ratsit/errors'
|
3
|
+
|
4
|
+
module Ratsit
|
5
|
+
|
6
|
+
SEARCH_TYPE_PERSON = 'PersonSearch'
|
7
|
+
SEARCH_TYPE_COMPANY = 'CompanySearch'
|
8
|
+
SEARCH_TYPE_ESTATE = 'EstateSearch'
|
9
|
+
|
10
|
+
def Ratsit.validate_search_type(search_type)
|
11
|
+
raise RatsitError, 'Invalid search_type argument' if !search_type.is_a?(String)
|
12
|
+
return [
|
13
|
+
SEARCH_TYPE_PERSON,
|
14
|
+
SEARCH_TYPE_COMPANY,
|
15
|
+
SEARCH_TYPE_ESTATE
|
16
|
+
].include?(search_type)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/ratsit.gemspec
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ratsit/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ratsit"
|
8
|
+
spec.version = Ratsit::VERSION
|
9
|
+
spec.authors = ["Stefan Nyman"]
|
10
|
+
spec.email = ["stefan@qoorp.com"]
|
11
|
+
|
12
|
+
spec.summary = "Ratsit searches..."
|
13
|
+
spec.description = "Ratsit searches..."
|
14
|
+
spec.homepage = "http://github.com/qoorp/ratsit"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
|
+
# delete this section to allow pushing this gem to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
21
|
+
else
|
22
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
+
end
|
24
|
+
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
spec.bindir = "exe"
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
|
30
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
31
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
32
|
+
spec.add_development_dependency "rspec", "~> 3.2"
|
33
|
+
|
34
|
+
spec.add_runtime_dependency "faraday", "~> 0.9.2"
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ratsit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Stefan Nyman
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-22 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.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
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
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.2'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: faraday
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.9.2
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.9.2
|
69
|
+
description: Ratsit searches...
|
70
|
+
email:
|
71
|
+
- stefan@qoorp.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- CODE_OF_CONDUCT.md
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- bin/console
|
83
|
+
- bin/setup
|
84
|
+
- lib/ratsit.rb
|
85
|
+
- lib/ratsit/errors.rb
|
86
|
+
- lib/ratsit/filters.rb
|
87
|
+
- lib/ratsit/monkey.rb
|
88
|
+
- lib/ratsit/package.rb
|
89
|
+
- lib/ratsit/person.rb
|
90
|
+
- lib/ratsit/request.rb
|
91
|
+
- lib/ratsit/search_type.rb
|
92
|
+
- lib/ratsit/version.rb
|
93
|
+
- ratsit.gemspec
|
94
|
+
homepage: http://github.com/qoorp/ratsit
|
95
|
+
licenses:
|
96
|
+
- MIT
|
97
|
+
metadata:
|
98
|
+
allowed_push_host: https://rubygems.org
|
99
|
+
post_install_message:
|
100
|
+
rdoc_options: []
|
101
|
+
require_paths:
|
102
|
+
- lib
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
requirements: []
|
114
|
+
rubyforge_project:
|
115
|
+
rubygems_version: 2.4.5.1
|
116
|
+
signing_key:
|
117
|
+
specification_version: 4
|
118
|
+
summary: Ratsit searches...
|
119
|
+
test_files: []
|