Skip to content

Commit

Permalink
Ungemmify to help it work inside a java app server after warbled
Browse files Browse the repository at this point in the history
Also don't include puma as will be inside app server in prod
  • Loading branch information
adz committed Sep 17, 2015
1 parent ac61b82 commit 9913831
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 84 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in quickets.gemspec
gemspec
gem 'roda'
gem 'rack-cors'
53 changes: 25 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,34 @@ Exposes the following http API:

In all but the simple "/" path, an api_key is required.

## Installation
Note:

This is a jruby gem and require Java 1.7+.

Add this line to your application's Gemfile:

```ruby
gem 'quickets'
```

And then execute:

$ bundle

Or install it yourself as:

$ gem install quickets
This is a jruby app and require Java 1.7+.

## Running

The QUICKETS_DIR env var must be set, which points to the directory
holding the configuration file.

QUICKETS_DIR=./config bundle exec puma
holding the configuration file. If not set, it is defaulted to `/quickets`
which on windows is the same as `C:\quickets`.

The puma cli has been copy-pasted to exe/quickets to allow simpler gem
install then run.
QUICKETS_DIR=./config bin/rackup

Warbler is also configured which will package up the jruby app along
with the jetty web server -- to use it:

warble executable war
QUICKETS_DIR=~/quickets/config java -jar quickets.war

Note that the java web server can't use a relative QUICKETS_DIR since it
will unpack the jar into a tmp directory.
The 'executable' param embeds jetty for cmd line run.

## Prod deployment

* Run `gem install warbler` to get the warbler utilitiy
* Run `warble war` to build dist/ROOT.war (note no "R" in the cmd)
* Copy dist/ROOT.war to your java app servers webapp dir

The war file will be unpacked and available on root (at least for
tomcat).

## Configuration

Expand All @@ -66,19 +58,24 @@ printer configuration.

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
After checking out the repo, run `bundle` to install dependencies.
Then, run `rake spec` to run the tests.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
You can also run `bin/console` for an interactive prompt that will allow you to experiment.

Depends on [sealink/ticket_printer](https://github.com/sealink/ticket_printer)
which is compiled, then built into a single jar, and exists in lib/jars.
which is compiled, then built into a single jar, and has been copied in lib/jars.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/quickets. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
Bug reports and pull requests are welcome on GitHub at
https://github.com/[USERNAME]/quickets. This project is intended to be a safe,
welcoming space for collaboration, and contributors are expected to adhere to the
[Contributor Covenant](contributor-covenant.org) code of conduct.


## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
The gem is available as open source under the terms of the
[MIT License](http://opensource.org/licenses/MIT).

1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)
Expand Down
16 changes: 16 additions & 0 deletions bin/rackup
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env jruby
#
# This file was generated by Bundler.
#
# The application 'rackup' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('rack', 'rackup')
7 changes: 0 additions & 7 deletions bin/setup

This file was deleted.

9 changes: 0 additions & 9 deletions exe/quickets

This file was deleted.

1 change: 1 addition & 0 deletions lib/quickets.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require "roda"

require "pathname"
require "quickets/version"
require "quickets/config"
require "quickets/logger"

Expand Down
37 changes: 0 additions & 37 deletions quickets.gemspec

This file was deleted.

0 comments on commit 9913831

Please sign in to comment.