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

Commit

Permalink
Rename to honey
Browse files Browse the repository at this point in the history
  • Loading branch information
Almad committed Aug 15, 2013
1 parent 01c750a commit 427267c
Show file tree
Hide file tree
Showing 20 changed files with 42 additions and 42 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiaryio
=============
Honey: All you need to attract API bees
==========================================

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

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


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

## Copyright

Copyright 2012 (c) Apiary Ltd.
Copyright 2012-2013 (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('apiary.gemspec'), binding, '.gemspec')
@gemspec ||= eval(File.read('honey.gemspec'), binding, '.gemspec')
end

YARD::Rake::YardocTask.new
Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions lib/apiary.rb

This file was deleted.

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

module Honey
end
6 changes: 3 additions & 3 deletions lib/apiary/cli.rb → lib/honey/cli.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding: utf-8
require 'optparse'
module Apiary
module Honey
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
Apiary::Command::Runner.run(command, options)
Honey::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 Apiary::Command::Help.banner
puts Honey::Command::Help.banner
exit 1
end

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

def self.run(cmd, options)
Apiary::Command.const_get(cmd.to_s.capitalize).send(:execute, options)
Honey::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 Apiary
module Honey
module Command
# Display version
class Version

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

end
Expand Down
2 changes: 1 addition & 1 deletion lib/apiary/version.rb → lib/honey/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Apiary
module Honey
VERSION = "0.0.6"
end
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 Apiary
module Honey
module Okapi
class ApiaryConnector
attr_reader :apiary_url, :blueprint
Expand Down
6 changes: 3 additions & 3 deletions lib/okapi/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'optparse'
require 'yaml'

module Apiary
module Honey
module Okapi
class CLI

Expand Down Expand Up @@ -38,7 +38,7 @@ def initialize(args)
def run
pass = true
@options[:test_spec].each { |spec|
pass = Apiary::Okapi::Test.new(@options[:blueprint], spec, @options[:test_url], @options[:output], @options[:apiary_url]).run()
pass = Honey::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
Apiary::Okapi::Help.banner
Honey::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 Apiary
module Honey
module Okapi
CONFIG_PATH = "apiary.yaml"
APIARY_URL = "https://api.apiary.io"
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 Apiary
module Honey
module Okapi
class Output
def self.get(output,resources, error)
output = Apiary::Okapi::Outputs.const_get(output.to_s.capitalize).send(:new, resources, error)
output = Honey::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 Apiary
module Honey
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 Apiary
module Honey
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 = Apiary::Okapi::ApiaryConnector.new(@apiary_url, @req_path, @res_path)
@connector = Honey::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
Apiary::Okapi::Output.get(@output_format, @resources, @error)
Honey::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 << Apiary::Okapi::Resource.new(res["uri"], res["method"], res["params"], res["expandedUri"], res["headers"], res["body"])
@resources << Honey::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 = Apiary::Okapi::Response.new(response.code, raw_headers, response.body)
resource.response = Honey::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 = Apiary::Okapi::ValidationResult.new()
resource.validation_result = Honey::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 = Apiary::Okapi::ValidationResult.new()
resource.response.validation_result = Honey::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)
Apiary::Okapi::Parser.new(test_spec)
Honey::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 Apiary::CLI do
describe Honey::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 'apiary'
require 'honey'

0 comments on commit 427267c

Please sign in to comment.