Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #26 from sgerrand/branding_changes_and_make_gem_re…

…leasable

Corrected branding, fixed broken tests, added test metrics, updated gemspec
  • Loading branch information...
commit a9fc56b9e8e9f533820abb5cbc1ea5b5ded6adbf 2 parents 3da0496 + 1b0d0e5
@maetl maetl authored
View
2  .autotest
@@ -0,0 +1,2 @@
+require 'autotest/bundler'
+require 'autotest/restart'
View
9 .gitignore
@@ -1,2 +1,7 @@
-.idea/
-*.rbc
+# Ignore bundler
+/.bundle
+/vendor/bundle
+/pkg
+
+# Ignore ci_reporter
+/spec/reports
View
8 Gemfile.lock
@@ -1,16 +1,19 @@
PATH
remote: .
specs:
- bigcommerce (0.0.5)
+ bigcommerce (0.0.6)
activesupport
json
GEM
remote: http://rubygems.org/
specs:
- activesupport (3.2.8)
+ activesupport (3.2.9)
i18n (~> 0.6)
multi_json (~> 1.0)
+ builder (3.1.4)
+ ci_reporter (1.7.3)
+ builder (>= 2.1.2)
diff-lcs (1.1.3)
fakeweb (1.3.0)
i18n (0.6.1)
@@ -34,6 +37,7 @@ PLATFORMS
DEPENDENCIES
bigcommerce!
+ ci_reporter
fakeweb
mocha
rake
View
12 README.md
@@ -1,7 +1,7 @@
-BigCommerce API V2 - Ruby Client
+Bigcommerce API V2 - Ruby Client
================================
-This library provides a wrapper around the BigCommerce REST API for use within
+This library provides a wrapper around the Bigcommerce REST API for use within
Ruby apps or via the console.
Note
@@ -19,7 +19,7 @@ Requirements
To connect to the API, you need the following credentials:
-- Secure URL pointing to a BigCommerce store
+- Secure URL pointing to a Bigcommerce store
- Username of an authorized admin user of the store
- API key for the user
@@ -46,7 +46,7 @@ follows:
```
require 'bigcommerce'
-api = BigCommerce::Api.new({
+api = Bigcommerce::Api.new({
:store_url => "https://store.mybigcommerce.com",
:username => "admin",
:api_key => "d81aada4c19c34d913e18f07fd7f36ca"
@@ -71,7 +71,7 @@ The API object acts as a gateway to all top level resources in the V2 API.
```
$ irb
>
-> api = BigCommerce::Api.new(...)
+> api = Bigcommerce::Api.new(...)
>
> api.get_products.each { |product| puts product.name }
>
@@ -83,7 +83,7 @@ $ irb
> category.name = "Laptops"
> category.update
>
-> brand = BigCommerce::Api::Brand.new
+> brand = Bigcommerce::Api::Brand.new
> brand.name = "Samsung"
> brand.create
>
View
7 Rakefile
@@ -1,10 +1,9 @@
-require 'rubygems'
-require 'bundler'
-Bundler::GemHelper.install_tasks
+require 'bundler/gem_tasks'
+require 'ci/reporter/rake/rspec'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
end
-task :default => :spec
+task :default => ['ci:setup:rspec', :spec]
View
26 bigcommerce.gemspec
@@ -2,20 +2,22 @@
require File.expand_path('../lib/bigcommerce/version', __FILE__)
Gem::Specification.new do |s|
- s.name = "bigcommerce"
- s.version = BigCommerce::VERSION
- s.date = Time.now.strftime("%Y-%m-%d")
- s.summary = "Enables Ruby applications to communicate with the BigCommerce API"
- s.email = "dev-accounts@bigcommerce.com"
- s.homepage = "http://github.com/bigcommerce/bigcommerce-api-ruby"
- s.description = "Enables Ruby applications to communicate with the BigCommerce API V2 (currently in beta trial)."
- s.has_rdoc = false
- s.authors = ["BigCommerce"]
- s.files = ["LICENSE", "Rakefile", "README.md", "bigcommerce.gemspec"] + Dir['./**/*.rb'] + Dir['./**/*.crt']
- s.add_dependency('json')
s.add_dependency('activesupport')
- s.add_development_dependency("rake")
+ s.add_dependency('json')
+ s.add_development_dependency("ci_reporter")
s.add_development_dependency("fakeweb")
s.add_development_dependency("mocha")
+ s.add_development_dependency("rake")
s.add_development_dependency("rspec", '~> 2.11')
+ s.authors = ["Bigcommerce"]
+ s.date = Time.now.strftime("%Y-%m-%d")
+ s.description = "Enables Ruby applications to communicate with the Bigcommerce API V2."
+ s.email = "dev-accounts@bigcommerce.com"
+ s.files = ["LICENSE", "Rakefile", "README.md", "bigcommerce.gemspec"] + Dir['./**/*.rb'] + Dir['./**/*.crt']
+ s.has_rdoc = false
+ s.homepage = "http://github.com/bigcommerce/bigcommerce-api-ruby"
+ s.name = "bigcommerce"
+ s.summary = "Enables Ruby applications to communicate with the Bigcommerce API"
+ s.test_files = Dir.glob('spec/**/*_spec.rb')
+ s.version = Bigcommerce::VERSION
end
View
2  lib/big_commerce.rb
@@ -0,0 +1,2 @@
+# Support legacy naming
+require 'bigcommerce'
View
12 lib/bigcommerce.rb
@@ -1,9 +1,7 @@
-require "rubygems"
require "cgi"
-require "uri"
-require "net/https"
require "json"
-
-require File.expand_path('../bigcommerce/version', __FILE__)
-require File.expand_path('../bigcommerce/api', __FILE__)
-require File.expand_path('../bigcommerce/connection', __FILE__)
+require "net/https"
+require "uri"
+require 'bigcommerce/api'
+require 'bigcommerce/connection'
+require 'bigcommerce/version'
View
4 lib/bigcommerce/api.rb
@@ -1,4 +1,4 @@
-module BigCommerce
+module Bigcommerce
class Api
def initialize(configuration={})
@@ -124,4 +124,4 @@ def get_collection(result)
end
end
-end
+end
View
4 lib/bigcommerce/connection.rb
@@ -1,4 +1,4 @@
-module BigCommerce
+module Bigcommerce
class Connection
def initialize(configuration)
@@ -104,4 +104,4 @@ def hash_to_params(hash)
class HttpError < Exception
end
-end
+end
View
7 lib/bigcommerce/version.rb
@@ -1,3 +1,6 @@
-module BigCommerce
- VERSION = "0.0.5"
+module Bigcommerce
+ major = 0
+ minor = 0
+ patch = 6
+ VERSION = [major, minor, patch].join('.') unless defined? Bigcommerce::VERSION
end
View
6 spec/models/api_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe BigCommerce::Api do
+describe Bigcommerce::Api do
before do
FakeWeb.allow_net_connect = false
FakeWeb.register_uri(:get, %r|https://test:12345@store-12345.mybigcommerce.com/api/v2/orders|, :body => load_json_fixture('order'), :status => 200, :content_type => "text/json")
@@ -11,7 +11,7 @@
end
let(:api) do
- BigCommerce::Api.new({
+ Bigcommerce::Api.new({
:store_url => "https://store-12345.mybigcommerce.com",
:username => "test", :api_key => "12345"
})
@@ -74,7 +74,7 @@
api.get_orders_by_date(Date.parse("2012-03-12"))
end
- it "converts from a date-time string when retrieving orders by date" do
+ it "converts from a datetime string when retrieving orders by date" do
api.connection.should_receive(:get).once.with("/orders", :params => {:min_date_created=> CGI::escape(rfc2822_datetime)})
api.connection.should_receive(:get).once.with("/orders", :params => {:min_date_created=> CGI::escape(rfc2822_date)})
View
4 spec/models/connection_spec.rb
@@ -17,11 +17,11 @@
end
end
-describe BigCommerce::Connection do
+describe Bigcommerce::Connection do
before { FakeWeb.allow_net_connect = false }
after { FakeWeb.clean_registry }
subject(:connection) do
- BigCommerce::Connection.new(
+ Bigcommerce::Connection.new(
:store_url => "https://store-12345.mybigcommerce.com",
:username => "test",
:api_key => "12345"
View
2  spec/spec_helper.rb
@@ -1,5 +1,5 @@
-require 'rubygems'
require 'bigcommerce'
+require 'date'
require 'fakeweb'
# Requires supporting ruby files with custom matchers and macros, etc,
Please sign in to comment.
Something went wrong with that request. Please try again.