lionshare 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1cffbf27f1bef5cbd38a544ab7ff81770d9469d4
4
- data.tar.gz: af2bda6ea69d318e4c1abd11d019dc5db8fb990f
3
+ metadata.gz: 5cedc9f5a30ea54c0f8c2765cdf0413fefa581b1
4
+ data.tar.gz: 4d47902fff84f021d34ee27374b60f2d4f07ded8
5
5
  SHA512:
6
- metadata.gz: 9e3a215431ec5cf9a1714b0a9bfc49d857e75c24929176ec31e51781588393f3f8f0031bb7910836b19af547827268ec27f88db550088de6bec6b385e97117ee
7
- data.tar.gz: 60342c048f9aa07910377a9d896fc2426f00b48904342823c5d349b9a141b554d6795c42075f808f730a5f7431c8e27569492af5a75d78da24a8a99eefc7bcfb
6
+ metadata.gz: a18a873e98eaefc85a315f97093894256ee60d2104e5daa56ebba2bb55830573c8eb74228005ed1c9a6fcb8ab76009203c8465eac5eb182a31cedd3512c4cea9
7
+ data.tar.gz: 46be2e45677c88f58595cb163c7fc0cd3e9c093ee960f741a267ffa45234ed1daa65c6500c2bfd7ad8315b84f68209849313eb651b4d181c4729ecd76a68e595
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Lionshare
2
2
 
3
- A Ruby interface to the Lionshare API.
3
+ A Ruby interface to the [Lionshare](https://github.com/lionsharecapital/lionshare-api) API.
4
4
 
5
5
  ## Installation
6
6
 
@@ -26,6 +26,19 @@ Initialize client:
26
26
  client = Lionshare::Client.new
27
27
  ```
28
28
 
29
+ ### Configuration
30
+
31
+ By default, requests are sent to `https://api.lionshare.capital/api`
32
+
33
+ You can change url to your own instance
34
+
35
+ `config/initializers/lionshare.rb`
36
+ ```ruby
37
+ Lionshare::Settings.configure do |config|
38
+ config.api_url = 'https://exchange.domain.com/api'
39
+ end
40
+ ```
41
+
29
42
  ### Prices
30
43
 
31
44
  ```ruby
@@ -62,12 +75,12 @@ client.markets.get(period: :hour)
62
75
  Response:
63
76
 
64
77
  ```ruby
65
- {"data"=>{"BTC"=>28317131524, "ETH"=>8372895792", "XRP"=>6477081639, "LTC"=>1562510222, "XEM"=>1104930000, "DASH"=>704585094, "ETC"=>606619545, "XMR"=>417501622}}
78
+ {"data"=>{"BTC"=>28317131524, "ETH"=>8372895792, "XRP"=>6477081639, "LTC"=>1562510222, "XEM"=>1104930000, "DASH"=>704585094, "ETC"=>606619545, "XMR"=>417501622}}
66
79
  ```
67
80
 
68
81
  ## Contributing
69
82
 
70
- Bug reports and pull requests are welcome on GitHub at https://github.com/kirillweb/lionshare.
83
+ Bug reports and pull requests are welcome on GitHub at https://github.com/kirillshevch/lionshare.
71
84
 
72
85
  ## License
73
86
 
@@ -1,9 +1,11 @@
1
+ require 'http'
2
+ require 'dry-configurable'
1
3
  require 'lionshare/version'
2
4
  require 'lionshare/client'
5
+ require 'lionshare/settings'
3
6
  require 'lionshare/wrapper/base'
4
7
  require 'lionshare/wrapper/markets'
5
8
  require 'lionshare/wrapper/prices'
6
- require 'http'
7
9
 
8
10
  module Lionshare
9
11
  end
@@ -0,0 +1,7 @@
1
+ module Lionshare
2
+ class Settings
3
+ extend ::Dry::Configurable
4
+
5
+ setting :api_url, 'https://api.lionshare.capital/api'
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Lionshare
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -1,10 +1,8 @@
1
1
  module Lionshare
2
2
  module Wrapper
3
3
  class Base
4
- API_URL = 'https://api.lionshare.capital/api'.freeze
5
-
6
4
  def initialize
7
- @root_url = API_URL + prefix
5
+ @root_url = Settings.config.api_url + prefix
8
6
  @client = HTTP::Client.new(headers: {
9
7
  'Accept': 'application/json',
10
8
  'Content-Type': 'application/json'
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ['lib']
24
24
 
25
25
  spec.add_dependency 'http'
26
+ spec.add_dependency 'dry-configurable', '~> 0.7'
26
27
 
27
28
  spec.add_development_dependency 'bundler', '~> 1.14'
28
29
  spec.add_development_dependency 'rake', '~> 10.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lionshare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Shevchenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-12 00:00:00.000000000 Z
11
+ date: 2017-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: dry-configurable
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.7'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.7'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -139,6 +153,7 @@ files:
139
153
  - circle.yml
140
154
  - lib/lionshare.rb
141
155
  - lib/lionshare/client.rb
156
+ - lib/lionshare/settings.rb
142
157
  - lib/lionshare/version.rb
143
158
  - lib/lionshare/wrapper/base.rb
144
159
  - lib/lionshare/wrapper/markets.rb