license-generator 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ tmp/*
6
+ .rvmrc
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # Version 0.0.1 (2011-05-05)
2
+
3
+ First version. Only supports BSD license.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in license-generator.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ Copyright (c) 2011, Justin Blake
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above copyright
10
+ notice, this list of conditions and the following disclaimer in the
11
+ documentation and/or other materials provided with the distribution.
12
+ * Neither the name of Hentzia nor the names of its
13
+ contributors may be used to endorse or promote products derived from this
14
+ software without specific prior written permission.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # OSS License Generator
2
+
3
+ Generate an open source license for your projects.
4
+
5
+ ## Usage:
6
+
7
+ lickjen [license] [options]
8
+
9
+ I thought a phonetic spelling would be easy to remember. My apologies to
10
+ anyone named Jennifer.
11
+
12
+ ## Supported licenses:
13
+
14
+ * [The BSD License](http://www.opensource.org/licenses/bsd-license.php)
15
+
16
+ lickjen bsd --name=[your name] --organization=[your organization]
17
+
18
+ ### Please add some!
19
+
20
+ There are a lot. See <http://www.opensource.org/licenses/alphabetical>.
21
+
22
+ 1. Fork the project
23
+ 2. Create a branch for your new license.
24
+ 3. Add a cucumber feature for your license: see `features/bsd_license.feature` for an example.
25
+ 4. Add a spec for your new license task to `spec/app_spec.rb`. Use the others as reference.
26
+ 5. Add your license task to `lib/license-generator/app.rb` and license template to `templates/[license].erb`. Use the others as reference.
27
+ 6. Add your new license to this README under "Supported licenses".
28
+ 7. Push it and send a pull request.
29
+ 8. I will pull it, bump the version number, and add you to the credits for fame and glory.
30
+
31
+ ## Credits
32
+
33
+ * Justin Blake <justin@hentzia.com>
34
+ * Bill Evans (help naming the binary)
data/Rakefile ADDED
@@ -0,0 +1,29 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+ desc "Run specs"
6
+ RSpec::Core::RakeTask.new(:spec) do |t|
7
+ t.rspec_opts = %w(--color)
8
+ end
9
+ namespace :spec do
10
+ desc "Run specs with output in documentation format"
11
+ RSpec::Core::RakeTask.new(:doc) do |t|
12
+ t.rspec_opts = ["--color", "--format d"]
13
+ end
14
+ end
15
+
16
+ require 'cucumber/rake/task'
17
+ Cucumber::Rake::Task.new(:features) do |features|
18
+ features.cucumber_opts = "features --tags ~@wip --format progress"
19
+ end
20
+ namespace :features do
21
+ Cucumber::Rake::Task.new(:pretty, "Run Cucumber features with output in pretty format") do |features|
22
+ features.cucumber_opts = "features --tags ~@wip --format pretty"
23
+ end
24
+ Cucumber::Rake::Task.new(:wip, "Run @wip (Work In Progress) Cucumber features") do |features|
25
+ features.cucumber_opts = "features --tags @wip --format progress"
26
+ end
27
+ end
28
+
29
+ task :default => [:spec, :features]
data/bin/lickjen ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ lib_dir = File.expand_path("../lib", File.dirname(__FILE__))
4
+ $:.unshift lib_dir unless $:.include?(lib_dir)
5
+
6
+ require "license-generator"
7
+ LicenseGenerator::App.start
@@ -0,0 +1,15 @@
1
+ Feature: Generate BSD License
2
+ In order to release my code under the BSD license
3
+ As an open source developer
4
+ I want to generate a BSD LICENSE file in my project
5
+
6
+ Scenario: Run `lickjen bsd` with no arguments
7
+ When I successfully run `lickjen bsd`
8
+ Then the output should contain "No value provided for required options"
9
+
10
+ Scenario: Run `lickjen bsd --name='Justin Blake' --organization=Hentzia`
11
+ When I successfully run `lickjen bsd --name='Justin Blake' --organization=Hentzia`
12
+ Then the output should say the file "LICENSE" was created
13
+ And a file named "LICENSE" should exist
14
+ And the file "LICENSE" should contain a copyright notice for "Justin Blake"
15
+ And the file "LICENSE" should contain "Neither the name of Hentzia nor the names of its"
@@ -0,0 +1,3 @@
1
+ Then /^I see the date$/ do
2
+ puts Time.now.inspect
3
+ end
@@ -0,0 +1,8 @@
1
+ Then /^the output should say the file "([^"]*)" was created$/ do |file|
2
+ Then "the output should match /create(.+)#{file}/"
3
+ end
4
+
5
+ Then /^the file "([^"]*)" should contain a copyright notice for "([^"]*)"$/ do |file, name|
6
+ year = Time.now.year
7
+ Then "the file \"#{file}\" should contain \"Copyright (c) #{year}, #{name}\""
8
+ end
@@ -0,0 +1,4 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'aruba/cucumber'
@@ -0,0 +1,6 @@
1
+ module LicenseGenerator
2
+ module CucumberHelpers
3
+ end
4
+ end
5
+
6
+ World(LicenseGenerator::CucumberHelpers)
@@ -0,0 +1,3 @@
1
+ module LicenseGenerator
2
+ autoload :App, "license-generator/app"
3
+ end
@@ -0,0 +1,18 @@
1
+ require 'thor'
2
+
3
+ module LicenseGenerator
4
+ class App < Thor
5
+ include Thor::Actions
6
+
7
+ # Path to the templates
8
+ def self.source_root
9
+ File.expand_path('../../templates', File.dirname(__FILE__))
10
+ end
11
+
12
+ desc "bsd", "Generate a BSD LICENSE"
13
+ method_options :name => :required, :organization => :required
14
+ def bsd
15
+ template "bsd.erb", "LICENSE"
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ module License
2
+ module Generator
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "license-generator/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "license-generator"
7
+ s.version = License::Generator::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Justin Blake"]
10
+ s.email = ["justin@hentzia.com"]
11
+ s.homepage = ""
12
+ s.summary = %q{Open Source License generator}
13
+ s.description = %q{Generate an open source license file in your project.}
14
+
15
+ s.rubyforge_project = "license-generator"
16
+
17
+ s.add_dependency "thor"
18
+
19
+ s.add_development_dependency "rake"
20
+ s.add_development_dependency "rspec"
21
+ s.add_development_dependency "cucumber"
22
+ s.add_development_dependency "aruba"
23
+
24
+ s.files = `git ls-files`.split("\n")
25
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
26
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
27
+ s.require_paths = ["lib"]
28
+ end
data/spec/app_spec.rb ADDED
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe LicenseGenerator::App do
4
+ before do
5
+ @app = LicenseGenerator::App.new
6
+ end
7
+
8
+ describe '#bsd' do
9
+ it "creates a LICENSE file from the bsd.erb template" do
10
+ @app.should_receive(:template).with("bsd.erb", "LICENSE")
11
+ @app.bsd
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ require "rubygems"
2
+ require "bundler/setup"
3
+
4
+ require 'rspec'
5
+ require 'license-generator'
6
+
7
+ RSpec.configure do |config|
8
+ config.fail_fast = true
9
+ end
data/templates/bsd.erb ADDED
@@ -0,0 +1,25 @@
1
+ Copyright (c) <%= Time.now.year %>, <%= options[:name] %>
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above copyright
10
+ notice, this list of conditions and the following disclaimer in the
11
+ documentation and/or other materials provided with the distribution.
12
+ * Neither the name of <%= options[:organization] %> nor the names of its
13
+ contributors may be used to endorse or promote products derived from this
14
+ software without specific prior written permission.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: license-generator
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Justin Blake
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-05-05 00:00:00 -04:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: thor
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: "0"
36
+ type: :development
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: rspec
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "0"
47
+ type: :development
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: cucumber
51
+ prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ type: :development
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: aruba
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: "0"
69
+ type: :development
70
+ version_requirements: *id005
71
+ description: Generate an open source license file in your project.
72
+ email:
73
+ - justin@hentzia.com
74
+ executables:
75
+ - lickjen
76
+ extensions: []
77
+
78
+ extra_rdoc_files: []
79
+
80
+ files:
81
+ - .gitignore
82
+ - CHANGELOG.md
83
+ - Gemfile
84
+ - LICENSE
85
+ - README.md
86
+ - Rakefile
87
+ - bin/lickjen
88
+ - features/bsd_license.feature
89
+ - features/step_definitions/debug_steps.rb
90
+ - features/step_definitions/license-generator_steps.rb
91
+ - features/support/env.rb
92
+ - features/support/helpers.rb
93
+ - lib/license-generator.rb
94
+ - lib/license-generator/app.rb
95
+ - lib/license-generator/version.rb
96
+ - license-generator.gemspec
97
+ - spec/app_spec.rb
98
+ - spec/spec_helper.rb
99
+ - templates/bsd.erb
100
+ has_rdoc: true
101
+ homepage: ""
102
+ licenses: []
103
+
104
+ post_install_message:
105
+ rdoc_options: []
106
+
107
+ require_paths:
108
+ - lib
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ none: false
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: "0"
115
+ required_rubygems_version: !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: "0"
121
+ requirements: []
122
+
123
+ rubyforge_project: license-generator
124
+ rubygems_version: 1.6.2
125
+ signing_key:
126
+ specification_version: 3
127
+ summary: Open Source License generator
128
+ test_files:
129
+ - features/bsd_license.feature
130
+ - features/step_definitions/debug_steps.rb
131
+ - features/step_definitions/license-generator_steps.rb
132
+ - features/support/env.rb
133
+ - features/support/helpers.rb
134
+ - spec/app_spec.rb
135
+ - spec/spec_helper.rb