Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Revert rename
Browse files Browse the repository at this point in the history
We decided to be professional and consistent after all

This reverts commits 427267c to 86d7f82
  • Loading branch information
Almad committed Aug 16, 2013
1 parent 86d7f82 commit b683077
Show file tree
Hide file tree
Showing 23 changed files with 52 additions and 64 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Honey: All you need to attract API bees
==========================================
apiaryio
=============

Command Line Interface to [Apiary](http://apiary.io])
Apiary.io CLI

[![Build Status](https://travis-ci.org/apiaryio/honey.png?branch=travis)](https://travis-ci.org/apiaryio/honey)
[![Build Status](https://travis-ci.org/apiaryio/apiary-client.png?branch=travis)](https://travis-ci.org/apiaryio/apiary-client)


## Install

``` bash
gem install honey
gem install apiaryio
```


Expand Down Expand Up @@ -40,7 +40,7 @@ machine, either using static files or using a standalone web server...

## Copyright

Copyright 2012-2013 (c) Apiary Ltd.
Copyright 2012 (c) Apiary Ltd.

## Contributors

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ task :doc => :yard
task :gem => :gemspec

def gemspec
@gemspec ||= eval(File.read('honey.gemspec'), binding, '.gemspec')
@gemspec ||= eval(File.read('apiary.gemspec'), binding, '.gemspec')
end

YARD::Rake::YardocTask.new
Expand Down
6 changes: 3 additions & 3 deletions honey.gemspec → apiary.gemspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/honey/version', __FILE__)
require File.expand_path('../lib/apiary/version', __FILE__)

Gem::Specification.new do |gem|
gem.authors = ["Apiary Ltd."]
Expand All @@ -12,9 +12,9 @@ Gem::Specification.new do |gem|
gem.files = `git ls-files`.split($\)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = "honey"
gem.name = "apiaryio"
gem.require_paths = ["lib"]
gem.version = Honey::VERSION
gem.version = Apiary::VERSION

gem.add_dependency "rest-client", "~> 1.6.7"
gem.add_dependency "rack", "~> 1.4.1"
Expand Down
6 changes: 3 additions & 3 deletions bin/apiary
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env ruby
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..','lib')))
require 'honey'
require 'apiary'
require 'okapi'

trap(:INT) { abort "" }
if ARGV[0] == 'okapi' || ARGV[0] == 'test'
ARGV.delete_at(0)
Honey::Okapi::CLI.new(ARGV)
Apiary::Okapi::CLI.new(ARGV)
else
Honey::CLI.new(ARGV)
Apiary::CLI.new(ARGV)
end
12 changes: 0 additions & 12 deletions bin/honey

This file was deleted.

7 changes: 7 additions & 0 deletions lib/apiary.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'rubygems'
require "apiary/version"
require "apiary/cli"
Dir["#{File.dirname(__FILE__)}/apiary/command/*.rb"].each { |f| require(f) }

module Apiary
end
6 changes: 3 additions & 3 deletions lib/honey/cli.rb → lib/apiary/cli.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding: utf-8
require 'optparse'
module Honey
module Apiary
class CLI

attr_reader :command
Expand All @@ -13,7 +13,7 @@ def initialize(args)
def run(args, options)
command = args.first || :help
command = @command if @command
Honey::Command::Runner.run(command, options)
Apiary::Command::Runner.run(command, options)
end

def parse_options!(args)
Expand Down Expand Up @@ -62,7 +62,7 @@ def parse_options!(args)

rescue OptionParser::InvalidOption => e
puts e
puts Honey::Command::Help.banner
puts Apiary::Command::Help.banner
exit 1
end

Expand Down
2 changes: 1 addition & 1 deletion lib/honey/command/help.rb → lib/apiary/command/help.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# encoding: utf-8
module Honey
module Apiary
module Command
# Display help
class Help
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'rack'
require 'ostruct'

module Honey
module Apiary
module Command
# Display preview of local blueprint file
class Preview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'rack'
require 'ostruct'

module Honey
module Apiary
module Command
# Display preview of local blueprint file
class Publish
Expand Down
4 changes: 2 additions & 2 deletions lib/honey/command/runner.rb → lib/apiary/command/runner.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# encoding: utf-8
module Honey
module Apiary
module Command
# Run commands
class Runner

def self.run(cmd, options)
Honey::Command.const_get(cmd.to_s.capitalize).send(:execute, options)
Apiary::Command.const_get(cmd.to_s.capitalize).send(:execute, options)
end

end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# encoding: utf-8
module Honey
module Apiary
module Command
# Display version
class Version

def self.execute(options)
puts Honey::VERSION
puts Apiary::VERSION
end

end
Expand Down
2 changes: 1 addition & 1 deletion lib/honey/version.rb → lib/apiary/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Honey
module Apiary
VERSION = "0.0.6"
end
7 changes: 0 additions & 7 deletions lib/honey.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/okapi/apiary_connector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'rest_client'
require 'json'

module Honey
module Apiary
module Okapi
class ApiaryConnector
attr_reader :apiary_url, :blueprint
Expand Down
10 changes: 5 additions & 5 deletions lib/okapi/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
require 'optparse'
require 'yaml'

module Honey
module Apiary
module Okapi
class CLI

def initialize(args)
case args.first
when 'help'
Honey::Okapi::Help.show
Apiary::Okapi::Help.show
exit 0
when 'okapi'
Honey::Okapi::Help.okapi
Apiary::Okapi::Help.okapi
exit 0
else
parse_options!(args)
Expand All @@ -38,7 +38,7 @@ def initialize(args)
def run
pass = true
@options[:test_spec].each { |spec|
pass = Honey::Okapi::Test.new(@options[:blueprint], spec, @options[:test_url], @options[:output], @options[:apiary_url]).run()
pass = Apiary::Okapi::Test.new(@options[:blueprint], spec, @options[:test_url], @options[:output], @options[:apiary_url]).run()
}
if pass
0
Expand Down Expand Up @@ -112,7 +112,7 @@ def parse_options!(args)
rescue OptionParser::InvalidOption => e
puts "\n"
puts e
Honey::Okapi::Help.banner
Apiary::Okapi::Help.banner
puts "\n"
exit 1
end
Expand Down
2 changes: 1 addition & 1 deletion lib/okapi/config.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# encoding: utf-8
module Honey
module Apiary
module Okapi
CONFIG_PATH = "apiary.yaml"
APIARY_URL = "https://api.apiary.io"
Expand Down
2 changes: 1 addition & 1 deletion lib/okapi/help.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# encoding: utf-8
module Honey
module Apiary
module Okapi
class Help

Expand Down
4 changes: 2 additions & 2 deletions lib/okapi/output.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# encoding: utf-8
Dir["#{File.dirname(__FILE__)}/outputs/*.rb"].each { |f| require(f) }

module Honey
module Apiary
module Okapi
class Output
def self.get(output,resources, error)
output = Honey::Okapi::Outputs.const_get(output.to_s.capitalize).send(:new, resources, error)
output = Apiary::Okapi::Outputs.const_get(output.to_s.capitalize).send(:new, resources, error)
output.get()
output.status
end
Expand Down
2 changes: 1 addition & 1 deletion lib/okapi/spec_parser.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'json'

module Honey
module Apiary
module Okapi
class Parser
attr_reader :data, :resources, :proces_all_bp_resources, :global_vars
Expand Down
16 changes: 8 additions & 8 deletions lib/okapi/test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# encoding: utf-8
require 'rest_client'

module Honey
module Apiary
module Okapi
class Test
def initialize(blueprint_path, test_spec_path, test_url, output, apiary_url)
Expand All @@ -12,7 +12,7 @@ def initialize(blueprint_path, test_spec_path, test_url, output, apiary_url)
@apiary_url = apiary_url
@req_path = GET_REQUESTS_PATH
@res_path = GET_RESULTS_PATH
@connector = Honey::Okapi::ApiaryConnector.new(@apiary_url, @req_path, @res_path)
@connector = Apiary::Okapi::ApiaryConnector.new(@apiary_url, @req_path, @res_path)
@proces_all_bp_resources = false
@output = []
@resources = []
Expand All @@ -26,7 +26,7 @@ def run
@resources = []
@error = e
end
Honey::Okapi::Output.get(@output_format, @resources, @error)
Apiary::Okapi::Output.get(@output_format, @resources, @error)
end

def test
Expand Down Expand Up @@ -60,7 +60,7 @@ def prepare

data[:data].each do |res|
raise Exception, 'Resource error "' + res['error'] + '" for resource "' + res["method"] + ' ' + res["uri"] + '"' if res['error']
@resources << Honey::Okapi::Resource.new(res["uri"], res["method"], res["params"], res["expandedUri"], res["headers"], res["body"])
@resources << Apiary::Okapi::Resource.new(res["uri"], res["method"], res["params"], res["expandedUri"], res["headers"], res["body"])
end

@resources
Expand All @@ -81,7 +81,7 @@ def get_responses
out
end

resource.response = Honey::Okapi::Response.new(response.code, raw_headers, response.body)
resource.response = Apiary::Okapi::Response.new(response.code, raw_headers, response.body)
rescue Exception => e
raise Exception, 'Can not get response for: ' + params.to_json + ' (' + e.to_s + ')'
end
Expand All @@ -99,15 +99,15 @@ def evaluate
data[:data].each { |validation|
@resources.each { |resource|
if validation['resource']['uri'] == resource.uri and validation['resource']['method'] == resource.method
resource.validation_result = Honey::Okapi::ValidationResult.new()
resource.validation_result = Apiary::Okapi::ValidationResult.new()
resource.validation_result.error = validation['errors']
resource.validation_result.schema_res = validation["validations"]['reqSchemaValidations']
resource.validation_result.body_pass = !validation["validations"]['reqData']['body']['isDifferent']
resource.validation_result.body_diff = validation["validations"]['reqData']['body']['diff']
resource.validation_result.header_pass = !validation["validations"]['reqData']['headers']['isDifferent']
resource.validation_result.header_diff = validation["validations"]['reqData']['headers']['diff']

resource.response.validation_result = Honey::Okapi::ValidationResult.new()
resource.response.validation_result = Apiary::Okapi::ValidationResult.new()
resource.response.validation_result.error = validation['errors']
resource.response.validation_result.schema_res = validation["validations"]['resSchemaValidations']
resource.response.validation_result.body_pass = !validation["validations"]['resData']['body']['isDifferent']
Expand All @@ -121,7 +121,7 @@ def evaluate
end

def get_test_spec_parser(test_spec)
Honey::Okapi::Parser.new(test_spec)
Apiary::Okapi::Parser.new(test_spec)
end

def parse_blueprint(blueprint_path)
Expand Down
2 changes: 1 addition & 1 deletion spec/cli_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper'

describe Honey::CLI do
describe Apiary::CLI do

it 'pass the test' do
true.should be_true
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require 'rspec'
require 'honey'
require 'apiary'

0 comments on commit b683077

Please sign in to comment.