methadone 1.3.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34efc1c3a2d8209ce45d31de375c52a3cb0fa3d8
4
- data.tar.gz: 957eeb5f82278810774d35308356768ca4e038c8
3
+ metadata.gz: 6de444d578e8db3bbaa2a7b3895b88f145b83b28
4
+ data.tar.gz: d7be790577cc1d22c2cbb75e7ec51cb90a6aac52
5
5
  SHA512:
6
- metadata.gz: e796c7cb5fa1980a1a1ca09ce3bb68f0c2c48acdd4e2ce9f5f3c95d1aea33654ee549b8b204bdae387b9c89aa3188496703a87366d93e4d97e1994f5a254c98a
7
- data.tar.gz: 68e86c8dcb4f412282af3fc9056e73a56b5dfe03d791509fd04c94d960cfb90f576d4541c457bae1c2fe02547f991d37b376d604277c441e09cf756ae69b4e86
6
+ metadata.gz: ffc0b213b1a251cdea19c2332d3272b326e4e90cf97f7a6618f48946a91a9c93df85ab961ebc39131859dea1fd03bfbd5c39606742adae5f5abc3a5e0990d142
7
+ data.tar.gz: 1067d5c60c27688248623630168081ca78c347eb1abdbb71cad223513be28b9c53b0f8e5b70f10f8ea0aa0d2d39573b819cba699d266920fd9e8ca6490accba1
data/.travis.yml CHANGED
@@ -5,9 +5,7 @@ script: 'bundle exec rake'
5
5
  rvm:
6
6
  - 1.9.2
7
7
  - 1.9.3
8
- - 1.8.7
9
8
  - 2.0.0
10
9
  - 2.1.0
11
- - ree
12
10
  - jruby-18mode
13
11
  - jruby-19mode
data/bin/methadone CHANGED
@@ -85,7 +85,7 @@ on("--force","Overwrite files if they exist")
85
85
  on("--[no-]readme","[Do not ]produce a README file")
86
86
  on("--rspec", "Generate RSpec unit tests instead of Test::Unit")
87
87
 
88
- licenses = %w(mit apache custom NONE)
88
+ licenses = %w(mit apache gplv2 gplv3 custom NONE)
89
89
  on("-l LICENSE","--license",licenses,"Specify the license for your project",'(' + licenses.join('|') + ')')
90
90
 
91
91
  use_log_level_option
@@ -20,6 +20,18 @@ Feature: Users should get the license included
20
20
  |license|
21
21
  |apache|
22
22
  |mit|
23
+ |gplv2|
24
+ |gplv3|
25
+
26
+ Scenario Outline: Stock licenses should be personalized
27
+ When I successfully run `methadone -l <license> tmp/newgem`
28
+ Then LICENSE.txt should contain user information and program name
29
+
30
+ Examples:
31
+ |license|
32
+ |mit|
33
+ |gplv2|
34
+ |gplv3|
23
35
 
24
36
  Scenario: We only support a few licenses
25
37
  When I run `methadone -l foobar tmp/newgem`
@@ -22,3 +22,8 @@ Then /^the README should reference the need for a license$/ do
22
22
  step %(the file "tmp/newgem/README.rdoc" should match /License:: INSERT LICENSE HERE/)
23
23
  end
24
24
 
25
+ Then(/^LICENSE\.txt should contain user information and program name$/) do
26
+ step %(the file "tmp/newgem/LICENSE.txt" should match /#{`git config user.name`}/)
27
+ step %(the file "tmp/newgem/LICENSE.txt" should match /newgem/)
28
+ step %(the file "tmp/newgem/LICENSE.txt" should match /#{Time.now.year}/)
29
+ end
data/lib/methadone/cli.rb CHANGED
@@ -98,5 +98,19 @@ module Methadone
98
98
  }
99
99
  end
100
100
 
101
+ def render_license_partial(partial)
102
+ ERB.new(File.read(template_dir('full/'+partial))).result(binding).strip
103
+ end
104
+
105
+ def gemspec
106
+ @gemspec || @gemspec=_get_gemspec
107
+ end
108
+ private
109
+ def _get_gemspec
110
+ files=Dir.glob("*.gemspec")
111
+ raise "Multiple gemspec files" if files.size>1
112
+ raise "No gemspec file" if files.size < 1
113
+ Gem::Specification::load(files.first)
114
+ end
101
115
  end
102
116
  end
@@ -1,3 +1,3 @@
1
1
  module Methadone #:nodoc:
2
- VERSION = "1.3.2" #:nodoc:
2
+ VERSION = "1.4.0" #:nodoc:
3
3
  end
@@ -0,0 +1,2 @@
1
+ Name: <%= gemspec.name %><%#TODO: Get program name more efficiently -%>
2
+ Copyright (c) <%= Time.now.year %> <%=`git config user.name`.strip %>
@@ -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 [yyyy] [name of copyright owner]
190
+ Copyright <%= Time.now.year %> <%=`git config.user` %>
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.
@@ -0,0 +1,14 @@
1
+ <%= render_license_partial('_license_head.txt.erb') %>
2
+
3
+ This program is free software; you can redistribute it and/or modify
4
+ it under the terms of the GNU General Public License as published by
5
+ the Free Software Foundation; either version 2 of the License, or
6
+ (at your option) any later version.
7
+
8
+ This program is distributed in the hope that it will be useful,
9
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ GNU General Public License for more details.
12
+
13
+ You should have received a copy of the GNU General Public License
14
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
@@ -0,0 +1,15 @@
1
+ <%= render_license_partial('_license_head.txt.erb') %>
2
+
3
+ This program is free software: you can redistribute it and/or modify
4
+ it under the terms of the GNU General Public License as published by
5
+ the Free Software Foundation, either version 3 of the License, or
6
+ (at your option) any later version.
7
+
8
+ This program is distributed in the hope that it will be useful,
9
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ GNU General Public License for more details.
12
+
13
+ You should have received a copy of the GNU General Public License
14
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
15
+
@@ -1,4 +1,4 @@
1
- Copyright (c) <%= Time.now.year %> YOUR NAME
1
+ <%= render_license_partial('_license_head.txt.erb') %>
2
2
 
3
3
  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:
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: methadone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - davetron5000
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-23 00:00:00.000000000 Z
11
+ date: 2014-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -217,12 +217,15 @@ files:
217
217
  - templates/full/.gitignore.erb
218
218
  - templates/full/README.rdoc.erb
219
219
  - templates/full/Rakefile.erb
220
+ - templates/full/_license_head.txt.erb
220
221
  - templates/full/apache_LICENSE.txt.erb
221
222
  - templates/full/bin/executable.erb
222
223
  - templates/full/custom_LICENSE.txt.erb
223
224
  - templates/full/features/executable.feature.erb
224
225
  - templates/full/features/step_definitions/executable_steps.rb.erb
225
226
  - templates/full/features/support/env.rb.erb
227
+ - templates/full/gplv2_LICENSE.txt.erb
228
+ - templates/full/gplv3_LICENSE.txt.erb
226
229
  - templates/full/mit_LICENSE.txt.erb
227
230
  - templates/rspec/spec/something_spec.rb.erb
228
231
  - templates/test_unit/test/tc_something.rb.erb