Permalink
Browse files

Initial release

  • Loading branch information...
gravis committed Mar 5, 2013
0 parents commit 86130247157cdd6f26545dfde4138bfc074deafd
@@ -0,0 +1,18 @@
+*.gem
+*.rbc
+.bundle
+.config
+.yardoc
+Gemfile.lock
+InstalledFiles
+_yardoc
+coverage
+doc/
+lib/bundler/man
+pkg
+rdoc
+spec/reports
+test/tmp
+test/version_tmp
+tmp
+config/gemnasium.yml
1 .rvmrc
@@ -0,0 +1 @@
+rvm ruby-1.9.3-p327@gemnasium-gem --create
@@ -0,0 +1,3 @@
+# 1.0.0 / 2013-03-04
+
+Initial release
@@ -0,0 +1,4 @@
+source 'https://rubygems.org'
+
+# Specify your gem's dependencies in gemnasium-deployus.gemspec
+gemspec
22 LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2013 Tech-Angels LLC
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
140 README.md
@@ -0,0 +1,140 @@
+# Gemnasium gem
+
+This gem lets you push your dependency files to [Gemnasium](https://gemnasium.com/) to track your project's dependencies and get notified about updates and security advisories.
+
+Gemnasium app offers Github integration with fully automated synchronization but you can use this gem if you don't want to authorize access to your repositories (ie: for privacy concern).
+
+Supported dependency files are:
+
+* Gemfile
+* Gemfile.lock
+* *.gemspec
+* package.json
+* npm-shrinkwrap.json
+
+## Installation
+
+Add this line to your application's Gemfile:
+
+ gem 'gemnasium'
+
+Or in your terminal:
+
+ $ gem install gemnasium
+
+Add configuration file in your project
+
+ $ gemnasium install
+
+Install command supports 2 options : `--rake` and `--git` to respectively install the gemnasium [rake task](#2-via-the-rake-task) and a [post-commit git hook](#3-via-the-post-commit-git-hook).
+
+`gemnasium install` will add the config/gemnasium.yml file to your .gitignore so your private API key won't be committed. If you use another versionning system, please remember to ignore this file, especially for public project.
+
+__Warning: your api key is dedicated to your own user account and must not be published!__
+
+Fill the values of the new config/gemnasium.yml file.
+
+## Usage
+
+There is multiple ways to use the gemnasium gem. You can choose whichever you prefer.
+
+### 1. Via the command line
+
+Using gemnasium from the command line is as simple as typing `gemnasium [command]` :
+
+__To create a project on Gemnasium:__
+
+ $ gemnasium create
+
+Create command will look for data in your config/gemnasium.yml configuration file to create a project.
+If your project was previously managed automatically from Github or if you want to change the visibility of an existing project, you can use the `--force` option to overwrite existing setup.
+
+Please note that automatic Github synchronization will be dropped once project is configured with this gem.
+
+__To push your dependency files on Gemnasium:__
+
+ $ gemnasium push
+
+### 2. Via the rake task
+
+Gemnasium gem comes with a rake task ready to be used. To use it, you need to install it via: `gemnasium install --rake`
+Once installed, you'll have access to 2 tasks:
+
+__To create a project on Gemnasium:__
+
+ $ rake gemnasium:create
+
+Create command will look for data in your config/gemnasium.yml configuration file to create a project.
+If your project was previously managed automatically from Github or if you want to change the visibility of an existing project, you can use the `gemnasium:create:force` subtask to overwrite existing setup.
+
+Please note that automatic Github synchronization will be dropped once project is configured with this gem.
+
+__To push your dependency files on Gemnasium:__
+
+ $ rake gemnasium:push
+
+### 3. Via the post-commit git hook
+
+We wrote for you a ready-to-use [post-commit git hook](lib/templates/post-commit).
+
+Once installed via `gemnasium install --git`, the gem will push your dependency files after each commit only if they have changed.
+
+### 4. Directly in your code
+
+If you need to use Gemnasium gem right into your code, you can do so just like below:
+
+```ruby
+require 'gemnasium'
+
+
+# To install gemnasium files
+#
+# options is a Hash which can contain the following keys:
+# project_path (required) - [String] path to the project
+# install_rake_task - [Boolean] whether or not to install the rake task
+# install_git_hook - [Boolean] whether or not to install the git hook
+Gemnasium.install(options)
+
+# To create your project on gemnasium
+#
+# options is a Hash which can contain the following keys:
+# project_path (required) - [String] path to the project
+# overwrite_attr - [Boolean] whether or not to overwrite existing project's attributes
+Gemnasium.create_project(options)
+
+# To push supported dependency files to gemnasium
+#
+# options is a Hash which can contain the following keys:
+# project_path (required) - [String] path to the project
+Gemnasium.push(options)
+```
+
+## Sample config
+
+Here is a sample config file for our public project **tech-angels/vandamme** available at https://gemnasium.com/tech-angels/vandamme
+
+```yaml
+api_key: "some_secret_api_key"
+profile_name: "tech-angels"
+project_name: "vandamme"
+project_visibility: "public"
+project_branch: "master"
+```
+
+## Troubleshooting
+
+Gemnasium will try to display the most accurate error message when something goes wrong.
+
+Though, if you're stil stuck with something, feel free to contact [Gemnasium support](https://gemnasium.freshdesk.com).
+
+## Contributing
+
+1. Fork the project.
+2. Make your feature or bug fix.
+3. Test it.
+4. Commit.
+5. Create new pull request.
+
+## Credits
+
+[![Tech-Angels](http://media.tumblr.com/tumblr_m5ay3bQiER1qa44ov.png)](http://www.tech-angels.com)
@@ -0,0 +1,6 @@
+require "bundler/gem_tasks"
+require 'rspec/core/rake_task'
+
+RSpec::Core::RakeTask.new('spec')
+
+task :default => :spec
@@ -0,0 +1,39 @@
+#!/usr/bin/env ruby
+#Adjust path in case called directly and not through gem
+$:.unshift "#{File.expand_path(File.dirname(__FILE__))}/../lib"
+
+require 'gemnasium'
+require 'gemnasium/options'
+require 'gemnasium/version'
+
+#Parse options
+begin
+ options, parser = Gemnasium::Options.parse ARGV
+rescue OptionParser::ParseError => e
+ $stderr.puts e.message.capitalize
+ $stderr.puts "Please see `gemnasium --help` for valid options"
+ abort
+end
+
+if options[:show_help]
+ puts parser
+ exit
+elsif options[:show_version]
+ puts "gemnasium v#{Gemnasium::VERSION}"
+ exit
+end
+
+# Set project path
+options[:project_path] = File.expand_path(".")
+
+case options[:command]
+when 'create'
+ Gemnasium.create_project options
+when 'install'
+ Gemnasium.install options
+when 'push'
+ Gemnasium.push options
+else
+ $stdout.puts "Please see `gemnasium --help` for valid options"
+ exit
+end
@@ -0,0 +1,53 @@
+Feature: Help messages about gemnasium gem
+
+ By using gemnasium [options], the user is able to get helpfull messages
+ about how to use the gemnasium gem.
+
+ Scenario: Without options
+ When I run `gemnasium`
+ Then the output should contain "Please see `gemnasium --help` for valid options"
+ And the exit status should be 0
+
+ Scenario: With invalid option
+ When I run `gemnasium -z`
+ Then the output should contain exactly:
+ """
+ Invalid option: -z
+ Please see `gemnasium --help` for valid options\n
+ """
+ And the exit status should be 1
+
+ Scenario Outline: With version option
+ When I run `gemnasium <option>`
+ Then the output should contain exactly:
+ """
+ gemnasium v1.0.0\n
+ """
+ And the exit status should be 0
+
+ Scenarios: Version options
+ | option |
+ | -v |
+ | --version |
+
+ Scenario Outline: With version option
+ When I run `gemnasium <option>`
+ Then the output should contain exactly:
+ """
+ Usage: gemnasium [options]
+ -v, --version Show Gemnasium version
+ -h, --help Display this message
+
+ Available commands are:
+ create : Create or update project on Gemnasium
+ install : Install the necessary config file
+ push : Push your dependency files to Gemnasium
+
+ See `gemnasium COMMAND --help` for more information on a specific command.\n
+ """
+ And the exit status should be 0
+
+ Scenarios: Version options
+ | option |
+ | -h |
+ | --help |
@@ -0,0 +1,12 @@
+Feature: Create or update a project on Gemnasium
+
+ By using gemnasium create [options], the user is able to create a new
+ project on Gemnasium or to update an existing one.
+
+ Scenario Outline: Without configuration file
+ Given a directory named "project/foo/bar"
+ And I cd to "project/foo/bar"
+ When I run `gemnasium create`
+ Then the output should contain "/config/gemnasium.yml) does not exist."
+ And the output should contain "Please run `gemnasium install`."
+ And the exit status should be 1
Oops, something went wrong.

0 comments on commit 8613024

Please sign in to comment.