Module: Love
- Defined in:
- lib/love.rb,
lib/love/gem.rb,
lib/love/share.rb,
lib/love/author.rb,
lib/love/version.rb,
lib/love/thank_words.rb
Defined Under Namespace
Modules: Share, ThankWords Classes: Author, Gem
Constant Summary collapse
- VERSION =
'0.1.4'
Class Attribute Summary collapse
-
.authors ⇒ Object
Returns the value of attribute authors.
-
.by_gemname ⇒ Object
readonly
Returns the value of attribute by_gemname.
-
.check_author ⇒ Object
readonly
Returns the value of attribute check_author.
-
.for_site ⇒ Object
readonly
Returns the value of attribute for_site.
-
.gems ⇒ Object
Returns the value of attribute gems.
-
.lang ⇒ Object
readonly
Returns the value of attribute lang.
-
.octokit ⇒ Object
readonly
Returns the value of attribute octokit.
-
.root ⇒ Object
readonly
Returns the value of attribute root.
Class Method Summary collapse
- .config(args = []) ⇒ Object
- .lets_start_from_heart! ⇒ Object
- .login_user ⇒ Object
- .parse_gemfile ⇒ Object
- .share_for(args) ⇒ Object
- .share_love ⇒ Object
Class Attribute Details
.authors ⇒ Object
Returns the value of attribute authors.
12 13 14 |
# File 'lib/love.rb', line 12 def @authors end |
.by_gemname ⇒ Object (readonly)
Returns the value of attribute by_gemname.
11 12 13 |
# File 'lib/love.rb', line 11 def by_gemname @by_gemname end |
.check_author ⇒ Object (readonly)
Returns the value of attribute check_author.
11 12 13 |
# File 'lib/love.rb', line 11 def @check_author end |
.for_site ⇒ Object (readonly)
Returns the value of attribute for_site.
11 12 13 |
# File 'lib/love.rb', line 11 def for_site @for_site end |
.gems ⇒ Object
Returns the value of attribute gems.
12 13 14 |
# File 'lib/love.rb', line 12 def gems @gems end |
.lang ⇒ Object (readonly)
Returns the value of attribute lang.
11 12 13 |
# File 'lib/love.rb', line 11 def lang @lang end |
.octokit ⇒ Object (readonly)
Returns the value of attribute octokit.
11 12 13 |
# File 'lib/love.rb', line 11 def octokit @octokit end |
.root ⇒ Object (readonly)
Returns the value of attribute root.
11 12 13 |
# File 'lib/love.rb', line 11 def root @root end |
Class Method Details
.config(args = []) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/love.rb', line 25 def config(args = []) @by_gemname = args.include? 'by_gem' @for_site = args.include? 'site' @check_author = args.include? '-v' @root = Pathname(__FILE__).parent @lang = 'en' @gems = [] @authors = [] end |
.lets_start_from_heart! ⇒ Object
43 44 45 |
# File 'lib/love.rb', line 43 def lets_start_from_heart! puts File.read(Love.root.join '../hearts/ascii1.txt') end |
.login_user ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/love.rb', line 35 def login_user puts 'Please, enter your github credentials that Octokit could work without github guest requests restrictions' hl = HighLine.new login = hl.ask "Login: " pass = hl.ask("Password: ") { |q| q.echo = '*' } @octokit = Octokit::Client.new login: login, password: pass end |
.parse_gemfile ⇒ Object
47 48 49 50 51 52 |
# File 'lib/love.rb', line 47 def parse_gemfile Bundler.load.specs.each do |spec| gem = Love::Gem.new(spec) @gems << gem end end |
.share_for(args) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/love.rb', line 14 def share_for(args) config(args) lets_start_from_heart! login_user parse_gemfile share_love end |