Skip to content

Commit

Permalink
Preparing for first release
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Nichols committed Mar 23, 2016
1 parent 17a58cf commit def126e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 19 deletions.
8 changes: 8 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
The Open Government Licence (OGL) Version 3

Copyright (c) 2016 Environment Agency

This source code is licensed under the Open Government Licence v3.0. To view this
licence, visit www.nationalarchives.gov.uk/doc/open-government-licence/version/3
or write to the Information Policy Team, The National Archives, Kew, Richmond,
Surrey, TW9 4DU.
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# OsMapRef

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/os_map_ref`. To experiment with that code, run `bin/console` for an interactive prompt.

TODO: Delete this and the text above, and describe your gem
This gem allows you to gather U.K. Ordnance Survey Eastings, North, and Map
References from a range of text inputs.

## Installation

Expand All @@ -22,15 +21,35 @@ Or install it yourself as:

## Usage

TODO: Write usage instructions here
To convert a map reference to eastings and northings:

```ruby
location = OsMapRef::Location.for 'ST5880171043'

location.easting == 358801
location.northing == 171043
location.map_reference == 'ST 58801 71043'
```

To convert eastings and northings to a map reference:

```ruby
location = OsMapRef::Location.for '358801, 171043'

location.easting == 358801
location.northing == 171043
location.map_reference == 'ST 58801 71043'
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` 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 `bin/setup` to install dependencies.
Then, run `rake test` to run the tests. You can also run `bin/console`
for an interactive prompt that will allow you to experiment.

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).
To install this gem onto your local machine, run `bundle exec rake install`.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/os_map_ref.
Bug reports and pull requests are welcome on GitHub at https://github.com/reggieb/os_map_ref.

17 changes: 5 additions & 12 deletions os_map_ref.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,17 @@ Gem::Specification.new do |spec|
spec.name = "os_map_ref"
spec.version = OsMapRef::VERSION
spec.authors = ["Rob Nichols"]
spec.email = ["[email protected]"]
spec.email = ["[email protected]"]

spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
spec.description = %q{TODO: Write a longer description or delete this line.}
spec.homepage = "TODO: Put your gem's website or public repo URL here."

# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
# delete this section to allow pushing this gem to any host.
if spec.respond_to?(:metadata)
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
else
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
end
spec.summary = %q{A tool to help handle UK Ordnance Survey map references, in particular to convert them to other coordinate systems}
spec.description = %q{This gem allows you to gather U.K. Ordnance Survey Eastings, North, and Map References from a range of text inputs; and output them in a consistent manner}
spec.homepage = "https://github.com/reggieb/os_map_ref"

spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.license = "LICENSE"

spec.add_development_dependency "bundler", "~> 1.11"
spec.add_development_dependency "rake", "~> 10.0"
Expand Down

0 comments on commit def126e

Please sign in to comment.