license-generator 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # Version 0.4.0 (2013-03-02)
2
+
3
+ * Take authors on the command line
4
+
1
5
  # Version 0.3.1 (2013-02-12)
2
6
 
3
7
  * New licenses:
data/README.md CHANGED
@@ -8,12 +8,16 @@ Generate an open source license for your projects.
8
8
 
9
9
  ## Usage:
10
10
 
11
- licgen [license]
11
+ licgen <license> [<author1>, [<author2> ...]]
12
12
 
13
13
  Too see the available license templates:
14
14
 
15
15
  licgen list
16
16
 
17
+ ## Available licenses
18
+
19
+ They are provided in the gem as [templates](templates/).
20
+
17
21
  ### Please add some!
18
22
 
19
23
  There are a lot. See <http://www.opensource.org/licenses/alphabetical>.
@@ -26,12 +30,21 @@ can also prompt the user for input like this:
26
30
 
27
31
  <%= option(:name) %>
28
32
 
33
+ Since author name will be needed for almost all templates, a special template
34
+ variable is provided:
35
+
36
+ <%= authors %>
37
+
38
+ If authors are not specified on the command line, it will prompt the user.
39
+
29
40
  ## Credits
30
41
 
31
42
  * Bill Evans ([@thirteenpixels][1]) for help naming the binary and pushing to make
32
43
  it not hard to add templates.
33
44
  * Dayton Nolan ([@daytonn][2]) for fixes and new templates.
45
+ * Leszek Rybicki ([@leszekr][3]) for new templates.
34
46
 
35
47
 
36
48
  [1]: https://github.com/thirteenpixels
37
49
  [2]: https://github.com/daytonn
50
+ [3]: https://github.com/leszekr
@@ -3,7 +3,7 @@ Feature: Generate a License
3
3
  As an open source developer
4
4
  I want to generate a LICENSE file in my project
5
5
 
6
- Scenario: Run `licgen bsd`
6
+ Scenario: Run without authors
7
7
  When I run `licgen bsd` interactively
8
8
  And I type "Justin Blake"
9
9
  And I type "Hentzia"
@@ -11,7 +11,12 @@ Feature: Generate a License
11
11
  And the file "LICENSE" should contain a copyright notice for "Justin Blake"
12
12
  And the file "LICENSE" should contain "Neither the name of Hentzia nor the names of its"
13
13
 
14
- # TODO: add a couple more scenarios when we have more templates
14
+ Scenario: Run with authors
15
+ When I run `licgen bsd "James Pearson"` interactively
16
+ And I type "Hentzia"
17
+ Then a file named "LICENSE" should exist
18
+ And the file "LICENSE" should contain a copyright notice for "James Pearson"
19
+ And the file "LICENSE" should contain "Neither the name of Hentzia nor the names of its"
15
20
 
16
21
  @wip
17
22
  Scenario: Bad template name
@@ -3,6 +3,7 @@ require 'thor'
3
3
  module LicenseGenerator
4
4
  class App < Thor
5
5
  include Thor::Actions
6
+ attr_accessor :authors
6
7
 
7
8
  # Path to the templates
8
9
  def self.source_root
@@ -17,6 +18,7 @@ module LicenseGenerator
17
18
  end
18
19
 
19
20
  def method_missing(meth, *args)
21
+ self.authors = args.empty? ? option(:authors) : args.join(', ')
20
22
  template "#{meth}.erb", "LICENSE"
21
23
  end
22
24
 
@@ -1,5 +1,5 @@
1
1
  module License
2
2
  module Generator
3
- VERSION = "0.3.1"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
data/spec/app_spec.rb CHANGED
@@ -40,7 +40,7 @@ describe LicenseGenerator::App do
40
40
 
41
41
  it "generates a template with a valid template name" do
42
42
  @app.should_receive(:template).with('mit.erb', 'LICENSE')
43
- @app.mit
43
+ @app.mit('Justin Blake')
44
44
  end
45
45
 
46
46
  end
@@ -1,4 +1,4 @@
1
- Copyright (c) <%= Time.now.year %> <%= option(:name) %>
1
+ Copyright (c) <%= Time.now.year %> <%= authors %>
2
2
 
3
3
  Academic Free License ("AFL") v. 3.0
4
4
 
@@ -187,7 +187,7 @@
187
187
  same "printed page" as the copyright notice for easier
188
188
  identification within third-party archives.
189
189
 
190
- Copyright <%= Time.now.year %> <%= option(:name) %>
190
+ Copyright <%= Time.now.year %> <%= authors %>
191
191
 
192
192
  Licensed under the Apache License, Version 2.0 (the "License");
193
193
  you may not use this file except in compliance with the License.
data/templates/bsd.erb CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) <%= Time.now.year %>, <%= option(:name) %>
1
+ Copyright (c) <%= Time.now.year %>, <%= authors %>
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
@@ -1,4 +1,4 @@
1
- Copyright (C) <%= Time.now.year %> <%= option(:name) %>
1
+ Copyright (C) <%= Time.now.year %> <%= authors %>
2
2
 
3
3
  This program is free software; you can redistribute it and/or modify
4
4
  it under the terms of the GNU General Public License as published by
@@ -1,4 +1,4 @@
1
- Copyright (C) <%= Time.now.year %> <%= option(:name) %>
1
+ Copyright (C) <%= Time.now.year %> <%= authors %>
2
2
 
3
3
  This program is free software; you can redistribute it and/or modify
4
4
  it under the terms of the GNU General Public License as published by
@@ -1,4 +1,4 @@
1
- Copyright (C) <%= Time.now.year %> <%= option(:name) %>
1
+ Copyright (C) <%= Time.now.year %> <%= authors %>
2
2
 
3
3
  This program is free software: you can redistribute it and/or modify
4
4
  it under the terms of the GNU General Public License as published by
data/templates/mit.erb CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) <%= Time.now.year %> <%= option(:name) %>
1
+ Copyright (c) <%= Time.now.year %> <%= authors %>
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Mozilla Public License, version 2.0
2
2
 
3
- Copyright (c) <%= Time.now.year %>, <%= option(:name) %>
3
+ Copyright (c) <%= Time.now.year %>, <%= authors %>
4
4
 
5
5
  1. Definitions
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: license-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-12 00:00:00.000000000 Z
12
+ date: 2013-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -141,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  segments:
143
143
  - 0
144
- hash: 2740199507811875689
144
+ hash: -3349718527898348751
145
145
  required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  none: false
147
147
  requirements:
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  segments:
152
152
  - 0
153
- hash: 2740199507811875689
153
+ hash: -3349718527898348751
154
154
  requirements: []
155
155
  rubyforge_project: license-generator
156
156
  rubygems_version: 1.8.25