Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .document

This file was deleted.

18 changes: 12 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: CI
on: [push]
on:
push:
branches: [main]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['3.3', '3.4', '4.0']
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle install
- run: bundle exec rspec
- run: bundle exec rake
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--color
--require spec_helper
1 change: 0 additions & 1 deletion .ruby-gemset

This file was deleted.

1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

17 changes: 5 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
source 'http://rubygems.org'
source 'https://rubygems.org'

# NationBuilder puts error messages in a different location.
gem 'oauth2', git: 'https://github.com/controlshift/oauth2.git'
gem 'json', '~> 2.1'
gem 'activesupport', '>3.0.0'
gemspec

group :development do
gem 'webmock', '~> 3.0', '>= 3.0.1'
gem 'byebug', '~> 9.0', '>= 9.0.6'
gem 'rspec', '~> 3.6'
gem 'bundler', '>= 0'
gem 'juwelier', '~> 2.4', '>= 2.4.7'
end
gem 'rake'
gem 'rspec', '~> 3.13'
gem 'webmock', '~> 3.23'
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ http://nationbuilder.com/api_documentation
require 'nation_builder'
client = NationBuilder.new(hostname: 'whatever.nationbuilder.com', client_id: 'id', client_secret: 'secret', username: 'you@nation.com', password: 'pass')
client.people.create('person' => {'first_name' => 'George', 'last_name' => 'Washington', 'email' => 'george@washington.com'})
client.people.match('email' => 'george@washington.com) # either a person hash or nil.
client.people.match('email' => 'george@washington.com') # either a person hash or nil.
client.people.list # returns people in nation
client.tags.list # all tags.
```
Expand All @@ -23,10 +23,7 @@ The current gem is minimalist -- but we'd welcome pull requests with additional

### Release

```
rake version:bump:minor
BRANCH=main rake release
```
Bump `NationBuilder::VERSION` in `lib/nation_builder/version.rb`, merge to main, then run `bundle exec rake release`.

### Copyright

Expand Down
49 changes: 3 additions & 46 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,49 +1,6 @@
# encoding: utf-8

require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'rake'

require 'juwelier'
Juwelier::Tasks.new do |gem|
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
gem.name = "nation_builder"
gem.homepage = "http://github.com/controlshift/nation_builder"
gem.license = "MIT"
gem.summary = "NationBuilder API wrapper"
gem.description = %Q{Ruby wrapper for NationBuilder API}
gem.email = "nathan@controlshiftlabs.com"
gem.authors = ["Nathan Woodhull", "Dan Schneiderman"]
# dependencies defined in Gemfile
end
Juwelier::RubygemsDotOrgTasks.new

require 'rspec/core'
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end

RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
end

task :default => :spec

require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
RSpec::Core::RakeTask.new(:spec)

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "nation_builder #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
task default: :spec
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

1 change: 1 addition & 0 deletions lib/nation_builder.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'oauth2'
require 'nation_builder/version'
require 'active_support/all'
require 'nation_builder/exceptions/validation_error'
require 'nation_builder/actions/show'
Expand Down
3 changes: 3 additions & 0 deletions lib/nation_builder/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module NationBuilder
VERSION = '0.1.0'
end
94 changes: 19 additions & 75 deletions nation_builder.gemspec
Original file line number Diff line number Diff line change
@@ -1,80 +1,24 @@
# Generated by juwelier
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
# stub: nation_builder 0.0.17 ruby lib
require_relative 'lib/nation_builder/version'

Gem::Specification.new do |s|
s.name = "nation_builder".freeze
s.version = "0.0.17"
Gem::Specification.new do |spec|
spec.name = 'nation_builder'
spec.version = NationBuilder::VERSION
spec.authors = ['Nathan Woodhull', 'Dan Schneiderman']
spec.email = ['nathan@controlshiftlabs.com']

s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Nathan Woodhull".freeze, "Dan Schneiderman".freeze]
s.date = "2021-09-27"
s.description = "Ruby wrapper for NationBuilder API".freeze
s.email = "nathan@controlshiftlabs.com".freeze
s.extra_rdoc_files = [
"LICENSE.txt",
"README.md"
]
s.files = [
".document",
".github/workflows/ci.yml",
".rspec",
".ruby-gemset",
".ruby-version",
"Gemfile",
"LICENSE.txt",
"README.md",
"Rakefile",
"VERSION",
"lib/nation_builder.rb",
"lib/nation_builder/actions/create.rb",
"lib/nation_builder/actions/list.rb",
"lib/nation_builder/actions/show.rb",
"lib/nation_builder/actions/update.rb",
"lib/nation_builder/client.rb",
"lib/nation_builder/exceptions/validation_error.rb",
"lib/nation_builder/people.rb",
"lib/nation_builder/remote_controller.rb",
"lib/nation_builder/tags.rb",
"nation_builder.gemspec",
"spec/client_spec.rb",
"spec/fixtures/not_found",
"spec/fixtures/people_list_empty",
"spec/fixtures/people_list_success",
"spec/nation_builder_spec.rb",
"spec/people_spec.rb",
"spec/spec_helper.rb"
]
s.homepage = "http://github.com/controlshift/nation_builder".freeze
s.licenses = ["MIT".freeze]
s.rubygems_version = "3.1.6".freeze
s.summary = "NationBuilder API wrapper".freeze
spec.summary = 'NationBuilder API wrapper'
spec.description = 'Ruby wrapper for NationBuilder API'
spec.homepage = 'https://github.com/controlshift/nation_builder'
spec.license = 'MIT'
spec.required_ruby_version = '>= 3.3'

if s.respond_to? :specification_version then
s.specification_version = 4
end
spec.metadata['source_code_uri'] = spec.homepage
spec.metadata['rubygems_mfa_required'] = 'true'

if s.respond_to? :add_runtime_dependency then
s.add_runtime_dependency(%q<oauth2>.freeze, [">= 0"])
s.add_runtime_dependency(%q<json>.freeze, ["~> 2.1"])
s.add_runtime_dependency(%q<activesupport>.freeze, ["> 3.0.0"])
s.add_development_dependency(%q<webmock>.freeze, ["~> 3.0", ">= 3.0.1"])
s.add_development_dependency(%q<byebug>.freeze, ["~> 9.0", ">= 9.0.6"])
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.6"])
s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.4", ">= 2.4.7"])
else
s.add_dependency(%q<oauth2>.freeze, [">= 0"])
s.add_dependency(%q<json>.freeze, ["~> 2.1"])
s.add_dependency(%q<activesupport>.freeze, ["> 3.0.0"])
s.add_dependency(%q<webmock>.freeze, ["~> 3.0", ">= 3.0.1"])
s.add_dependency(%q<byebug>.freeze, ["~> 9.0", ">= 9.0.6"])
s.add_dependency(%q<rspec>.freeze, ["~> 3.6"])
s.add_dependency(%q<bundler>.freeze, [">= 0"])
s.add_dependency(%q<juwelier>.freeze, ["~> 2.4", ">= 2.4.7"])
end
end
spec.files = Dir['lib/**/*.rb', 'LICENSE.txt', 'README.md']
spec.require_paths = ['lib']

spec.add_dependency 'activesupport', '>= 7.0'
spec.add_dependency 'json', '>= 2.1'
spec.add_dependency 'oauth2', '~> 2.0'
end
2 changes: 1 addition & 1 deletion spec/client_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe NationBuilder::Client do
shared_examples 'request' do
Expand Down
1 change: 0 additions & 1 deletion spec/fixtures/not_found

This file was deleted.

4 changes: 4 additions & 0 deletions spec/fixtures/not_found.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"code": "not_found",
"message": "Record not found"
}
1 change: 0 additions & 1 deletion spec/fixtures/people_list_empty

This file was deleted.

7 changes: 7 additions & 0 deletions spec/fixtures/people_list_empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"page": 20,
"total_pages": 1,
"per_page": 10,
"total": 4,
"results": []
}
1 change: 0 additions & 1 deletion spec/fixtures/people_list_success

This file was deleted.

Loading
Loading