opensource 0.6.1 → 0.6.2

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: 39b285b8f211a3ed4f00eb494c290fd31e4bd137
4
- data.tar.gz: f738ac1de6cc359ab5fcc93823ac25d9f44ed1a3
3
+ metadata.gz: b71bfd2ad3dee64ad2488205434dfa845fccbe62
4
+ data.tar.gz: 84ec7190d8741aef42e702d9dac2f1418bebe12c
5
5
  SHA512:
6
- metadata.gz: e3f8725c004f4a8b509ec68edf5e081f5a4bba2f937475f3703e296dc1b84d30c75dee031bd968420d4ff8a567eb607ce7f8bd685c037f998ed761df6ffe1a8f
7
- data.tar.gz: 10ebdf67b1bad3493841a0d67c63754d7d7c23be313f35a267a940bca8bd7aa150d6f43fb1336da4152c5c1bf290983825ceaefd3ffd948cf95e92b748dc8947
6
+ metadata.gz: a7fd97d8f962565a9a186eb06b43ea27f255e58b78e37888e7774210a3f42ff49b40ec0becc0db3ddcf17439d1c867cae3e84ee9034aa72f8d3bfa8d94db7a8c
7
+ data.tar.gz: 7335b6e8b8c720b7f43faf2dabf40082ff36ac9fc3f7cd5e9cb26dd676d6b100f321f19fd73985f99679abb61e58d5f26c9d3bc217573fdb37fc6a9c39222b5a
@@ -0,0 +1,5 @@
1
+ languages:
2
+ Ruby: true
3
+ JavaScript: true
4
+ exclude_paths:
5
+ - 'templates'
data/History.md CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ 0.6.2 / 2015-06-02
3
+ ==================
4
+
5
+ * refactor lib to separate out requesting from owner
6
+ * add code climate
7
+
2
8
  0.6.1 / 2015-05-31
3
9
  ==================
4
10
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OpenSource
2
2
 
3
- [![Code Climate](https://codeclimate.com/github/mohnish/opensource.rb/badges/gpa.svg)](https://codeclimate.com/github/mohnish/opensource.rb)
3
+ [![Code Climate](https://codeclimate.com/github/mohnish/opensource/badges/gpa.svg)](https://codeclimate.com/github/mohnish/opensource)
4
4
 
5
5
  Command line tool that lets you add an open source license to your project by running a simple command.
6
6
 
@@ -12,11 +12,11 @@ option_parser = OptionParser.new do |opts|
12
12
  opts.separator 'Specific options:'
13
13
 
14
14
  opts.on('-s', '--setup', 'Setup user credentials in ~/.osrc file') do |s|
15
- OpenSource::Owner.set_credentials
15
+ OpenSource.setup_owner_credentails
16
16
  exit
17
17
  end
18
18
 
19
- opts.on('-l', '--license LICENSE', OpenSource::LICENSES, "LICENSE can be #{OpenSource::LICENSES.join('|')}") do |l|
19
+ opts.on('-l', '--license LICENSE', OpenSource::LICENSES, "LICENSE can be #{OpenSource::LICENSES.join(', ')}") do |l|
20
20
  options[:license] = l
21
21
  end
22
22
 
@@ -42,7 +42,7 @@ begin
42
42
  option_parser.parse!
43
43
  if options.empty?
44
44
  puts option_parser
45
- exit 1
45
+ exit 0
46
46
  end
47
47
 
48
48
  OpenSource::License.new(options).process
@@ -7,4 +7,18 @@ module OpenSource
7
7
  LICENSES = Dir.entries(File.expand_path("../../templates", __FILE__)).map do |filename|
8
8
  File.basename(filename, '.erb') if !['.', '..'].include?(filename)
9
9
  end.compact
10
+
11
+ def self.request_owner_credentials
12
+ puts "Enter full name: "
13
+ name = gets.chomp
14
+ puts "Enter email address: "
15
+ email = gets.chomp
16
+
17
+ { name: name, email: email }
18
+ end
19
+
20
+ def self.setup_owner_credentails
21
+ owner_credentials = request_owner_credentials
22
+ Owner.set_credentials(owner_credentials)
23
+ end
10
24
  end
@@ -2,34 +2,30 @@ module OpenSource
2
2
  module Owner
3
3
  extend self
4
4
 
5
- def set_credentials
6
- puts "Enter full name: "
7
- name = gets.chomp
8
- puts "Enter email address: "
9
- email = gets.chomp
5
+ OSRC_PATH = File.expand_path("~/.osrc")
10
6
 
11
- f = File.new(File.expand_path("~/.osrc"), "w")
12
- f.write <<-CREDENTIALS
13
- name: #{name}
14
- email: #{email}
7
+ def set_credentials credentials
8
+ f = File.new(OSRC_PATH, "w")
9
+ f.write <<-CREDENTIALS.gsub /^\s+/, ""
10
+ name: #{credentials[:name]}
11
+ email: #{credentials[:email]}
12
+ escaped_email: &lt;#{credentials[:email]}&gt;
15
13
  CREDENTIALS
16
14
  f.close
17
15
  end
18
16
 
19
17
  def get_credentials
20
- user = {}
18
+ credentials = {}
21
19
 
22
- IO.foreach(File.expand_path("~/.osrc")) do |line|
20
+ IO.foreach(OSRC_PATH) do |line|
23
21
  current_line = line.strip
24
22
  if !current_line.empty?
25
23
  key, value = current_line.split(':')
26
- user[key.strip] = value.strip
24
+ credentials[key.strip.to_sym] = value.strip
27
25
  end
28
26
  end
29
27
 
30
- user['escaped_email'] = "&lt;#{user['email']}&gt;"
31
-
32
- user
28
+ credentials
33
29
  end
34
30
  end
35
31
  end
@@ -1,3 +1,3 @@
1
1
  module OpenSource
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
@@ -187,7 +187,7 @@ APPENDIX: How to apply the Apache License to your work.
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 %> <%= @user['name'] %> <%= @user['escaped_email'] %>
190
+ Copyright <%= Time.now.year %> <%= @user[:name] %> <%= @user[:escaped_email] %>
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.
@@ -199,4 +199,4 @@ Unless required by applicable law or agreed to in writing, software
199
199
  distributed under the License is distributed on an "AS IS" BASIS,
200
200
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
201
  See the License for the specific language governing permissions and
202
- limitations under the License.
202
+ limitations under the License.
@@ -1,4 +1,4 @@
1
- Copyright (c) <%= Time.now.year %> <%= @user['name'] %> <%= @user['escaped_email'] %>
1
+ Copyright (c) <%= Time.now.year %> <%= @user[:name] %> <%= @user[:escaped_email] %>
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
@@ -8,17 +8,17 @@ modification, are permitted provided that the following conditions are met:
8
8
  * Redistributions in binary form must reproduce the above copyright
9
9
  notice, this list of conditions and the following disclaimer in the
10
10
  documentation and/or other materials provided with the distribution.
11
- * Neither the name of <%= @user['name'] %> nor the
11
+ * Neither the name of <%= @user[:name] %> nor the
12
12
  names of its contributors may be used to endorse or promote products
13
13
  derived from this software without specific prior written permission.
14
14
 
15
15
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
16
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
17
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
- DISCLAIMED. IN NO EVENT SHALL <%= @user['name'].upcase %> BE LIABLE FOR ANY
18
+ DISCLAIMED. IN NO EVENT SHALL <%= @user[:name].upcase %> BE LIABLE FOR ANY
19
19
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
20
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
21
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
22
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
23
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
632
632
  the "copyright" line and a pointer to where the full notice is found.
633
633
 
634
634
  <one line to give the program's name and a brief idea of what it does.>
635
- Copyright (C) <%= Time.now.year %> <%= @user['name'] %> <%= @user['escaped_email'] %>
635
+ Copyright (C) <%= Time.now.year %> <%= @user[:name] %> <%= @user[:escaped_email] %>
636
636
 
637
637
  This program is free software: you can redistribute it and/or modify
638
638
  it under the terms of the GNU General Public License as published by
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
652
652
  If the program does terminal interaction, make it output a short
653
653
  notice like this when it starts in an interactive mode:
654
654
 
655
- Copyright (C) <%= Time.now.year %> <%= @user['name'] %> <%= @user['escaped_email'] %>
655
+ Copyright (C) <%= Time.now.year %> <%= @user[:name] %> <%= @user[:escaped_email] %>
656
656
  This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
657
  This is free software, and you are welcome to redistribute it
658
658
  under certain conditions; type `show c' for details.
@@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
671
671
  may consider it more useful to permit linking proprietary applications with
672
672
  the library. If this is what you want to do, use the GNU Lesser General
673
673
  Public License instead of this License. But first, please read
674
- <http://www.gnu.org/philosophy/why-not-lgpl.html>.
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) <%= Time.now.year %> <%= @user['name'] %> <%= @user['escaped_email'] %>
3
+ Copyright (c) <%= Time.now.year %> <%= @user[:name] %> <%= @user[:escaped_email] %>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
19
  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
20
  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
21
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opensource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohnish Thallavajhula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-01 00:00:00.000000000 Z
11
+ date: 2015-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -47,6 +47,7 @@ executables:
47
47
  extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
+ - ".codeclimate.yml"
50
51
  - ".gitignore"
51
52
  - Gemfile
52
53
  - History.md