Commit 27c3dddd authored by Anthony Martin's avatar Anthony Martin
Browse files

Initial commit.

parent f477239d
Pipeline #12658 canceled with stages
# Contributing
Everyone is welcome to contribute code to Steemit, Inc. projects. We have a Code of Conduct;
Everyone is welcome to contribute code to Galactica Actual projects. We have a Code of Conduct;
we ask that you please follow it in all your interactions with our team and your fellow
contributors.
......@@ -64,7 +64,7 @@ We will clarify standards of acceptable behavior and we will take appropriate
and fair corrective action in response to any instances of unacceptable behavior.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting us at github.abuse@steemit.com. All
reported by contacting us at github.abuse@martin-studio.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. We
maintain strict confidentiality with regard to the reporter of an incident.
......
PATH
remote: .
specs:
steem-ruby (0.9.4)
hive-ruby (1.0.0.pre.1)
base58 (~> 0.2, >= 0.2.3)
bindata (~> 2.4, >= 2.4.4)
bitcoin-ruby (~> 0.0, >= 0.0.18)
......@@ -13,48 +13,61 @@ PATH
GEM
remote: https://rubygems.org/
specs:
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
awesome_print (1.8.0)
base58 (0.2.3)
bindata (2.4.4)
bitcoin-ruby (0.0.18)
bindata (2.4.7)
bitcoin-ruby (0.0.20)
eventmachine
ffi
scrypt
coderay (1.1.2)
crack (0.4.3)
safe_yaml (~> 1.0.0)
docile (1.3.1)
ffi (1.9.25)
hashdiff (0.3.7)
docile (1.3.2)
eventmachine (1.2.7)
ffi (1.12.2)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
hashdiff (1.0.1)
hashie (3.6.0)
json (2.1.0)
io-console (0.5.6)
irb (1.2.4)
reline (>= 0.0.1)
json (2.3.0)
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
multi_json (~> 1.10)
method_source (0.9.1)
minitest (5.11.3)
method_source (1.0.0)
minitest (5.14.0)
minitest-line (0.6.5)
minitest (~> 5.0)
minitest-proveit (1.0.0)
minitest (> 5, < 7)
multi_json (1.13.1)
pry (0.12.0)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
public_suffix (3.0.3)
rake (12.3.1)
safe_yaml (1.0.4)
simplecov (0.16.1)
multi_json (1.14.1)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.4)
rake (13.0.1)
reline (0.1.4)
io-console (~> 0.5)
safe_yaml (1.0.5)
scrypt (3.0.7)
ffi-compiler (>= 1.0, < 2.0)
simplecov (0.18.5)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
vcr (4.0.0)
webmock (3.4.2)
simplecov-html (~> 0.11)
simplecov-html (0.12.2)
vcr (5.1.0)
webmock (3.8.3)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
yard (0.9.16)
hashdiff (>= 0.4.0, < 2.0.0)
yard (0.9.25)
PLATFORMS
ruby
......@@ -62,16 +75,17 @@ PLATFORMS
DEPENDENCIES
awesome_print (~> 1.8, >= 1.8.0)
bundler (~> 1.16, >= 1.16.1)
hive-ruby!
irb (~> 1.2, >= 1.2.3)
minitest (~> 5.10, >= 5.10.3)
minitest-line (~> 0.6, >= 0.6.4)
minitest-proveit (~> 1.0, >= 1.0.0)
pry (~> 0.11, >= 0.11.3)
rake (~> 12.3, >= 12.3.0)
rake (~> 13.0.1, >= 12.3.0)
simplecov (~> 0.15, >= 0.15.1)
steem-ruby!
vcr (~> 4.0, >= 4.0.0)
vcr (~> 5.1, >= 4.0.0)
webmock (~> 3.3, >= 3.3.0)
yard (~> 0.9, >= 0.9.12)
BUNDLED WITH
1.16.5
1.16.6
MIT License
Copyright (c) 2018 steem-ruby
Copyright (c) 2020 hive-ruby
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[![Gem Version](https://badge.fury.io/rb/steem-ruby.svg)](https://badge.fury.io/rb/steem-ruby)
[![Inline docs](http://inch-ci.org/github/steemit/steem-ruby.svg?branch=master&style=shields)](http://inch-ci.org/github/steemit/steem-ruby)
[![Gem Version](https://badge.fury.io/rb/hive-ruby.svg)](https://badge.fury.io/rb/hive-ruby)
<!-- [![Inline docs](http://inch-ci.org/github/GalacticaActual/hive-ruby.svg?branch=master&style=shields)](http://inch-ci.org/github/GalacticaActual/hive-ruby) -->
# `steem-ruby`
# `hive-ruby`
Steem-ruby the Ruby API for Steem blockchain.
Hive-ruby the Ruby API for Hive blockchain.
Full documentation: http://www.rubydoc.info/gems/steem-ruby
<!-- Full documentation: http://www.rubydoc.info/gems/hive-ruby -->
**Note:** *This library depends on AppBase methods that are a work in progress.*
## `radiator` vs. `hive-ruby`
## `radiator` vs. `steem-ruby`
The `hive-ruby` gem was written from the ground up by `@inertia`, who is also the author of [`radiator`](https://github.com/inertia186/radiator).
The `steem-ruby` gem was written from the ground up by `@inertia`, who is also the author of [`radiator`](https://github.com/inertia186/radiator).
> "I intend to continue work on `radiator` indefinitely. But in `radiator-0.5`, I intend to refactor `radiator` so that is uses `hive-ruby` as its core. This means that some features of `radiator` like Serialization will become redundant. I think it's still useful for radiator to do its own serialization because it reduces the number of API requests." - @inertia
> "I intend to continue work on `radiator` indefinitely. But in `radiator-0.5`, I intend to refactor `radiator` so that is uses `steem-ruby` as its core. This means that some features of `radiator` like Serialization will become redundant. I think it's still useful for radiator to do its own serialization because it reduces the number of API requests." - @inertia
`radiator` | `steem-ruby`
`radiator` | `hive-ruby`
---------- | ------------
Has internal failover logic | Can have failover delegated externally
Passes `error` responses to the caller | Handles `error` responses and raises exceptions
......@@ -27,7 +25,7 @@ Does not (yet) support `json-rpc-batch` requests | Supports `json-rpc-batch` req
## Getting Started
The steem-ruby gem is compatible with Ruby 2.2.5 or later.
The hive-ruby gem is compatible with Ruby 2.2.5 or later.
### Install the gem for your project
......@@ -36,19 +34,19 @@ The steem-ruby gem is compatible with Ruby 2.2.5 or later.
To install the gem on your computer, run in shell:
```bash
gem install steem-ruby
gem install hive-ruby
```
... then add in your code:
```ruby
require 'steem'
require 'hive'
```
To add the gem as a dependency to your project with [Bundler](http://bundler.io/), you can add this line in your Gemfile:
```ruby
gem 'steem-ruby', require: 'steem'
gem 'hive-ruby', require: 'hive'
```
## Examples
......@@ -63,19 +61,19 @@ params = {
weight: weight
}
Steem::Broadcast.vote(wif: wif, params: params) do |result|
Hive::Broadcast.vote(wif: wif, params: params) do |result|
puts result
end
```
*See: [Broadcast](https://www.rubydoc.info/gems/steem-ruby/Steem/Broadcast)*
<!-- *See: [Broadcast](https://www.rubydoc.info/gems/hive-ruby/Hive/Broadcast)* -->
### Streaming
The value passed to the block is an object, with the keys: `:type` and `:value`.
```ruby
stream = Steem::Stream.new
stream = Hive::Stream.new
stream.operations do |op|
puts "#{op.type}: #{op.value}"
......@@ -85,7 +83,7 @@ end
To start a stream from a specific block number, pass it as an argument:
```ruby
stream = Steem::Stream.new
stream = Hive::Stream.new
stream.operations(at_block_num: 9001) do |op|
puts "#{op.type}: #{op.value}"
......@@ -95,7 +93,7 @@ end
You can also grab the related transaction id and block number for each operation:
```ruby
stream = Steem::Stream.new
stream = Hive::Stream.new
stream.operations do |op, trx_id, block_num|
puts "#{block_num} :: #{trx_id}"
......@@ -106,7 +104,7 @@ end
To stream only certain operations:
```ruby
stream = Steem::Stream.new
stream = Hive::Stream.new
stream.operations(types: :vote_operation) do |op|
puts "#{op.type}: #{op.value}"
......@@ -116,7 +114,7 @@ end
Or pass an array of certain operations:
```ruby
stream = Steem::Stream.new
stream = Hive::Stream.new
stream.operations(types: [:comment_operation, :vote_operation]) do |op|
puts "#{op.type}: #{op.value}"
......@@ -126,7 +124,7 @@ end
Or (optionally) just pass the operation(s) you want as the only arguments. This is semantic sugar for when you want specific types and take all of the defaults.
```ruby
stream = Steem::Stream.new
stream = Hive::Stream.new
stream.operations(:vote_operation) do |op|
puts "#{op.type}: #{op.value}"
......@@ -136,7 +134,7 @@ end
To also include virtual operations:
```ruby
stream = Steem::Stream.new
stream = Hive::Stream.new
stream.operations(include_virtual: true) do |op|
puts "#{op.type}: #{op.value}"
......@@ -155,7 +153,7 @@ params = {
weight: weight
}
Steem::Broadcast.vote(wif: [wif1, wif2], params: params) do |result|
Hive::Broadcast.vote(wif: [wif1, wif2], params: params) do |result|
puts result
end
```
......@@ -163,7 +161,7 @@ end
In addition to signing with multiple `wif` private keys, it is possible to also export a partially signed transaction to have signing completed by someone else.
```ruby
builder = Steem::TransactionBuilder.new(wif: wif1)
builder = Hive::TransactionBuilder.new(wif: wif1)
builder.put(vote: {
voter: voter,
......@@ -183,8 +181,8 @@ Then send the contents of `trx.json` to the other signing party so they can priv
```ruby
trx = open('trx.json').read
builder = Steem::TransactionBuilder.new(wif: wif2, trx: trx)
api = Steem::CondenserApi.new
builder = Hive::TransactionBuilder.new(wif: wif2, trx: trx)
api = Hive::CondenserApi.new
trx = builder.transaction
api.broadcast_transaction_synchronous(trx)
```
......@@ -192,28 +190,28 @@ api.broadcast_transaction_synchronous(trx)
### Get Accounts
```ruby
api = Steem::DatabaseApi.new
api = Hive::DatabaseApi.new
api.find_accounts(accounts: ['steemit', 'alice']) do |result|
api.find_accounts(accounts: ['hiveio', 'alice']) do |result|
puts result.accounts
end
```
*See: [Api](https://www.rubydoc.info/gems/steem-ruby/Steem/Api)*
<!-- *See: [Api](https://www.rubydoc.info/gems/hive-ruby/Hive/Api)* -->
### Reputation Formatter
```ruby
rep = Steem::Formatter.reputation(account.reputation)
rep = Hive::Formatter.reputation(account.reputation)
puts rep
```
### Tests
* Clone the client repository into a directory of your choice:
* `git clone https://github.com/steemit/steem-ruby.git`
* `git clone https://gitlab.syncad.com/hive/hive-ruby.git`
* Navigate into the new folder
* `cd steem-ruby`
* `cd hive-ruby`
* All tests can be invoked as follows:
* `bundle exec rake test`
* To run `static` tests:
......@@ -223,7 +221,7 @@ puts rep
* To run `threads` tests (which quickly verifies thread safety):
* `bundle exec rake test:threads`
* To run `testnet` tests (which does actual broadcasts)
* `TEST_NODE=https://testnet.steemitdev.com bundle exec rake test:testnet`
* `TEST_NODE=https://testnet-api.openhive.network bundle exec rake test:testnet`
You can also run other tests that are not part of the above `test` execution:
......@@ -234,12 +232,12 @@ You can also run other tests that are not part of the above `test` execution:
If you want to point to any node for tests, instead of letting the test suite pick the default, set the environment variable to `TEST_NODE`, e.g.:
```bash
$ TEST_NODE=https://api.steemitdev.com bundle exec rake test
$ TEST_NODE=https://testnet-api.openhive.network bundle exec rake test
```
## Contributions
Patches are welcome! Contributors are listed in the `steem-ruby.gemspec` file. Please run the tests (`rake test`) before opening a pull request and make sure that you are passing all of them. If you would like to contribute, but don't know what to work on, check the issues list.
Patches are welcome! Contributors are listed in the `hive-ruby.gemspec` file. Please run the tests (`rake test`) before opening a pull request and make sure that you are passing all of them. If you would like to contribute, but don't know what to work on, check the issues list.
## Issues
......
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'yard'
require 'steem'
require 'hive'
Rake::TestTask.new(test: ['clean:vcr', 'test:threads']) do |t|
t.libs << 'test'
......@@ -25,15 +25,15 @@ namespace :test do
t.libs << 'test'
t.libs << 'lib'
t.test_files = [
'test/steem/account_by_key_api_test.rb',
'test/steem/account_history_api_test.rb',
'test/steem/block_api_test.rb',
'test/steem/database_api_test.rb',
'test/steem/follow_api_test.rb',
'test/steem/jsonrpc_test.rb',
'test/steem/market_history_api_test.rb',
'test/steem/tags_api_test.rb',
'test/steem/witness_api_test.rb'
'test/hive/account_by_key_api_test.rb',
'test/hive/account_history_api_test.rb',
'test/hive/block_api_test.rb',
'test/hive/database_api_test.rb',
'test/hive/follow_api_test.rb',
'test/hive/jsonrpc_test.rb',
'test/hive/market_history_api_test.rb',
'test/hive/tags_api_test.rb',
'test/hive/witness_api_test.rb'
]
t.ruby_opts << if ENV['HELL_ENABLED']
'-W2'
......@@ -50,8 +50,8 @@ namespace :test do
t.libs << 'test'
t.libs << 'lib'
t.test_files = [
'test/steem/broadcast_test.rb',
'test/steem/transaction_builder_test.rb'
'test/hive/broadcast_test.rb',
'test/hive/transaction_builder_test.rb'
]
t.ruby_opts << if ENV['HELL_ENABLED']
'-W2'
......@@ -68,7 +68,7 @@ namespace :test do
t.libs << 'test'
t.libs << 'lib'
t.test_files = [
'test/steem/testnet_test.rb'
'test/hive/testnet_test.rb'
]
t.ruby_opts << if ENV['HELL_ENABLED']
'-W2'
......@@ -82,20 +82,30 @@ namespace :test do
next if !!ENV['TEST']
threads = []
api = Steem::Api.new(url: ENV['TEST_NODE'])
database_api = Steem::DatabaseApi.new(url: ENV['TEST_NODE'])
api = Hive::Api.new(url: ENV['TEST_NODE'])
database_api = Hive::DatabaseApi.new(url: ENV['TEST_NODE'])
witnesses = {}
keys = %i(created url total_missed props running_version
hardfork_version_vote hardfork_time_vote)
low_participation_warning_seen = false
if defined? Thread.report_on_exception
Thread.report_on_exception = true
end
database_api.get_active_witnesses do |result|
abort 'Bad result from: database_api.get_active_witnesses' if result.nil?
print "Found #{result.witnesses.size} witnesses ..."
result.witnesses.each do |witness_name|
if witness_name == '' && !low_participation_warning_seen
warn "\nWarning: low witness participation detected."
low_participation_warning_seen = true
next
end
threads << Thread.new do
api.get_witness_by_account(witness_name) do |witness|
witnesses[witness.owner] = witness.map do |k, v|
......@@ -141,8 +151,8 @@ namespace :stream do
task :block_range, [:mode, :at_block_num] do |t, args|
mode = (args[:mode] || 'irreversible').to_sym
first_block_num = args[:at_block_num].to_i if !!args[:at_block_num]
stream = Steem::Stream.new(url: ENV['TEST_NODE'], mode: mode)
api = Steem::Api.new(url: ENV['TEST_NODE'])
stream = Hive::Stream.new(url: ENV['TEST_NODE'], mode: mode)
api = Hive::Api.new(url: ENV['TEST_NODE'])
last_block_num = nil
last_timestamp = nil
range_complete = false
......@@ -189,8 +199,8 @@ namespace :stream do
task :trx_range, [:mode, :at_block_num] do |t, args|
mode = (args[:mode] || 'irreversible').to_sym
first_block_num = args[:at_block_num].to_i if !!args[:at_block_num]
stream = Steem::Stream.new(url: ENV['TEST_NODE'], mode: mode)
api = Steem::Api.new(url: ENV['TEST_NODE'])
stream = Hive::Stream.new(url: ENV['TEST_NODE'], mode: mode)
api = Hive::Api.new(url: ENV['TEST_NODE'])
api.get_dynamic_global_properties do |properties|
current_block_num = if mode == :head
......@@ -212,8 +222,8 @@ namespace :stream do
task :op_range, [:mode, :at_block_num] do |t, args|
mode = (args[:mode] || 'irreversible').to_sym
first_block_num = args[:at_block_num].to_i if !!args[:at_block_num]
stream = Steem::Stream.new(url: ENV['TEST_NODE'], mode: mode)
api = Steem::Api.new(url: ENV['TEST_NODE'])
stream = Hive::Stream.new(url: ENV['TEST_NODE'], mode: mode)
api = Hive::Api.new(url: ENV['TEST_NODE'])
api.get_dynamic_global_properties do |properties|
current_block_num = if mode == :head
......@@ -235,8 +245,8 @@ namespace :stream do
task :vop_range, [:mode, :at_block_num] do |t, args|
mode = (args[:mode] || 'irreversible').to_sym
first_block_num = args[:at_block_num].to_i if !!args[:at_block_num]
stream = Steem::Stream.new(url: ENV['TEST_NODE'], mode: mode)
api = Steem::Api.new(url: ENV['TEST_NODE'])
stream = Hive::Stream.new(url: ENV['TEST_NODE'], mode: mode)
api = Hive::Api.new(url: ENV['TEST_NODE'])
api.get_dynamic_global_properties do |properties|
current_block_num = if mode == :head
......@@ -258,8 +268,8 @@ namespace :stream do
task :all_op_range, [:mode, :at_block_num] do |t, args|
mode = (args[:mode] || 'irreversible').to_sym
first_block_num = args[:at_block_num].to_i if !!args[:at_block_num]
stream = Steem::Stream.new(url: ENV['TEST_NODE'], mode: mode)
api = Steem::Api.new(url: ENV['TEST_NODE'])
stream = Hive::Stream.new(url: ENV['TEST_NODE'], mode: mode)
api = Hive::Api.new(url: ENV['TEST_NODE'])
api.get_dynamic_global_properties do |properties|
current_block_num = if mode == :head
......@@ -284,9 +294,9 @@ end
task default: :test
desc 'Ruby console with steem already required.'
desc 'Ruby console with hive already required.'
task :console do
exec 'irb -r steem -I ./lib'
exec 'irb -r hive -I ./lib'
end
namespace :clean do
......@@ -301,7 +311,7 @@ namespace :show do
desc 'Shows known API names.'
task :apis do
url = ENV['URL']
jsonrpc = Steem::Jsonrpc.new(url: url)
jsonrpc = Hive::Jsonrpc.new(url: url)
api_methods = jsonrpc.get_api_methods
puts api_methods.keys
end
......@@ -309,23 +319,39 @@ namespace :show do
desc 'Shows known method names for specified API.'
task :methods, [:api] do |t, args|
url = ENV['URL']
jsonrpc = Steem::Jsonrpc.new(url: url)
jsonrpc = Hive::Jsonrpc.new(url: url)
api_methods = jsonrpc.get_api_methods
api_methods[args[:api]].each do |method|
jsonrpc.get_signature(method: "#{args[:api]}.#{method}") do |signature|
print "#{method} "
params = signature.args.map do |k, v|
if v =~ /\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2]\d|3[0-1])T(2[0-3]|[01]\d):[0-5]\d:[0-5]\d/
"#{k}: Time"
elsif v.class == Hashie::Array
"#{k}: []"
elsif v.class == Hashie::Mash
"#{k}: {}"
else
"#{k}: #{v.class}"
api_names = if !!args[:api]
[args[:api]]
else
Hive::Fallback::API_METHODS.keys
end
api_names.each do |api_name|
unless !!api_methods[api_name.to_s]
puts "Skipped API: #{api_name}"
next
end
api_methods[api_name.to_s].each do |method|
jsonrpc.get_signature(method: "#{api_name}.#{method}") do |signature|
print "#{api_name}.#{method} "
params = signature.args.map do |k, v|
if v =~ /\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2]\d|3[0-1])T(2[0-3]|[01]\d):[0-5]\d:[0-5]\d/
"#{k}: Time"
elsif v.class == Hashie::Array
"#{k}: []"
elsif v.class == Hashie::Mash
"#{k}: {}"
else
"#{k}: #{v.class}"
end
end
puts params.join(', ')
end
puts params.join(', ')
end
end
end
......
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'steem/version'
require 'hive/version'
Gem::Specification.new do |spec|
spec.name = 'steem-ruby'
spec.version = Steem::VERSION
spec.name = 'hive-ruby'
spec.version = Hive::VERSION
spec.authors = ['Anthony Martin']
spec.email = ['anthony@steem.com']
spec.email = ['hive-ruby@martin-studio.com']
spec.summary = %q{Steem Ruby Client}
spec.description = %q{Client for accessing the Steem blockchain.}
spec.homepage = 'https://github.com/steem/steem-ruby'
spec.summary = %q{Hive Ruby Client}
spec.description = %q{Client for accessing the Hive blockchain.}
spec.homepage = 'https://gitlab.syncad.com/hive/hive-ruby'
spec.license = 'MIT'
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test)/}) }
spec.require_paths = ['lib']
spec.add_development_dependency 'bundler', '~> 1.16', '>= 1.16.1'
spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.0'
spec.add_development_dependency 'rake', '~> 13.0.1', '>= 12.3.0'
spec.add_development_dependency 'minitest', '~> 5.10', '>= 5.10.3'
spec.add_development_dependency 'minitest-line', '~> 0.6', '>= 0.6.4'
spec.add_development_dependency 'minitest-proveit', '~> 1.0', '>= 1.0.0'
spec.add_development_dependency 'webmock', '~> 3.3', '>= 3.3.0'
spec.add_development_dependency 'simplecov', '~> 0.15', '>= 0.15.1'
spec.add_development_dependency 'vcr', '~> 4.0', '>= 4.0.0'
spec.add_development_dependency 'vcr', '~> 5.1', '>= 4.0.0'
spec.add_development_dependency 'yard', '~> 0.9', '>= 0.9.12'
spec.add_development_dependency 'pry', '~> 0.11', '>= 0.11.3'
spec.add_development_dependency 'awesome_print', '~> 1.8', '>= 1.8.0'
spec.add_development_dependency 'irb', '~> 1.2', '>= 1.2.3'
spec.add_dependency 'json', '~> 2.1', '>= 2.1.0'
spec.add_dependency 'logging', '~> 2.2', '>= 2.2.0'
......
# encoding: UTF-8
require 'json' unless defined?(JSON)
require 'net/https'
require 'hashie'
require 'hive/version'
require 'hive/utils'