Skip to content
This repository was archived by the owner on Dec 8, 2017. It is now read-only.

Commit f95378b

Browse files
committed
Gemify connect_vbms
* Build connect_vbms into a gem instead of using it as a binary * add a gemspec * move dependencies into the gemspec * remove send.rb * convert the root makefile into a rakefile for ease of gem building * update the documentation to reflect these changes * add a version to the vbms module
1 parent 7cb7937 commit f95378b

12 files changed

+62
-292
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ vendor/bundle
99
.ruby-version
1010
.ruby-gemset
1111

12+
Gemfile.lock
1213
docs/_build/
14+
15+
pkg

Gemfile

+1-19
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,2 @@
11
source 'https://rubygems.org'
2-
3-
gem 'httpi'
4-
gem 'nokogiri'
5-
gem 'xmlenc'
6-
7-
# to install without postgres, "bundle install --without postgres"
8-
group :postgres do
9-
gem 'pg'
10-
end
11-
12-
group :development do
13-
gem 'byebug'
14-
gem 'pry-nav'
15-
end
16-
17-
group :development, :test do
18-
gem 'rspec'
19-
gem 'equivalent-xml'
20-
end
2+
gemspec

Gemfile.lock

-74
This file was deleted.

Makefile

-7
This file was deleted.

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ Connect VBMS is a Ruby library for connecting to VBMS.
99
- Sphinx 1.3.1 or above (`pip install sphinx`)
1010
- Ruby 2.2 or above
1111
- Bundler 1.10 or above (`gem install bundle`)
12-
- PostgreSQL 9.4 or above
1312

1413
## Build
1514

1615
From the root directory, run:
1716

18-
`make build`
17+
`rake build`
1918

2019
## Tests
2120

@@ -33,4 +32,4 @@ The tests are dependent on your network and on the VBMS test server being up and
3332

3433
From the root directory, run:
3534

36-
`make docs`
35+
`rake docs`

Rakefile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
require 'bundler/gem_tasks'
2+
3+
task :build_java do
4+
sh "make -C src build"
5+
end
6+
7+
task :docs do
8+
sh "make -C docs html"
9+
end
10+
11+
Rake::Task[:build].prerequisites << Rake::Task[:build_java]
12+
Rake::Task[:build].prerequisites << Rake::Task[:docs]

connect_vbms.gemspec

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# coding: utf-8
2+
lib = File.expand_path('../src', __FILE__)
3+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4+
require 'vbms/version'
5+
6+
Gem::Specification.new do |spec|
7+
spec.name = "connect_vbms"
8+
spec.version = VBMS::VERSION
9+
spec.authors = ["Alex Gaynor", "Bill Mill", "Albert Wong"]
10+
11+
12+
spec.summary = %q{Connect to VBMS with ease}
13+
spec.description = %q{Connect to VBMS with ease}
14+
spec.homepage = "http://va.gov"
15+
16+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
17+
# delete this section to allow pushing this gem to any host.
18+
if spec.respond_to?(:metadata)
19+
spec.metadata['allowed_push_host'] = ""
20+
else
21+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22+
end
23+
24+
git_files = `git ls-files -z`.split("\x00").reject { |f| f.match(%r{^(test|spec|features|\.java)/}) }
25+
spec.files = git_files + Dir['classes/*.class']
26+
spec.require_paths = ["src"]
27+
28+
spec.add_development_dependency "bundler", "~> 1.10"
29+
spec.add_development_dependency "rake", "~> 10.0"
30+
spec.add_development_dependency "byebug", "~> 5"
31+
spec.add_development_dependency "rspec", "~> 3.3"
32+
spec.add_development_dependency "pry-nav", "~> 0.2"
33+
spec.add_development_dependency "equivalent-xml", "~> 0.6"
34+
35+
spec.add_runtime_dependency "httpi", "~> 2.4"
36+
spec.add_runtime_dependency "nokogiri", "~> 1.6"
37+
spec.add_runtime_dependency "xmlenc", "~> 0.2"
38+
end

docs/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Welcome to Connect VBMS
44
Connect VBMS is an SDK for integrating with VBMS from Ruby.
55

66
To get started, you'll first need to get credentials from the VBMS team.
7-
You'll also need to make sure you have ``javac`` installed (version 1.7 or higher), and run ``make``
8-
in the root of the Connect VBMS repo.
7+
You'll also need to make sure you have ``javac`` installed (version 1.7 or higher), and run
8+
``rake`` in the root of the Connect VBMS repo to build a gem in the ``pkg`` dir.
99

1010
Once you have credentials for VBMS, you can dive in:
1111

spec/send_spec.rb

-30
This file was deleted.

src/send.rb

-157
This file was deleted.

src/vbms.rb

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
require 'vbms/common'
1010
require 'vbms/client'
1111
require 'vbms/requests'
12+
require 'vbms/version'

src/vbms/version.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module VBMS
2+
VERSION = "0.0.1"
3+
end

0 commit comments

Comments
 (0)