Module: Arigato

Defined in:
lib/arigato.rb,
lib/arigato/cli.rb,
lib/arigato/view.rb,
lib/arigato/version.rb

Defined Under Namespace

Classes: CLI, View

Constant Summary collapse

VERSION =

arigato version

"0.1.5"

Class Method Summary collapse

Class Method Details

.spec(name, homepage, author) ⇒ Object



44
45
46
47
48
49
50
# File 'lib/arigato.rb', line 44

def spec(name, homepage, author)
  Gem::Specification.new do |gem|
    gem.name          = name
    gem.authors       = [author]
    gem.homepage      = homepage
  end
end

.specs(file) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/arigato.rb', line 11

def specs(file)
  path = Pathname.new(file)
  lockfile = path.sub_ext('.lock')
  dsl = Bundler::Dsl.new
  dsl.eval_gemfile(file)
  specs = dsl.to_definition(lockfile, {}).specs.to_a

  specs.unshift(self.spec('Ruby', 'http://www.ruby-lang.org/', 'Yukihiro Matsumoto'))

  specs.reject { |spec| spec.name == 'arigato' }
end

.specs_array(file, labeld = true) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/arigato.rb', line 23

def specs_array(file, labeld = true)
  specs(file).map do |spec|
    {
      name: spec.name,
      homepage: spec.homepage,
      author: spec.author
    }
  end
end

.specs_hash(file) ⇒ Object



33
34
35
36
37
38
39
40
41
42
# File 'lib/arigato.rb', line 33

def specs_hash(file)
  hash = {}
  specs(file).each do |spec|
    hash[spec.name] = {
      homepage: spec.homepage,
      author: spec.author
    }
  end
  hash
end

.themes_dirObject



7
8
9
# File 'lib/arigato.rb', line 7

def themes_dir
  Pathname.new(File.join(File.dirname(__FILE__), 'arigato', 'themes'))
end