Class: RStack::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rstack/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gem_name) {|_self| ... } ⇒ Configuration

Returns a new instance of Configuration.

Yields:

  • (_self)

Yield Parameters:



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/rstack/configuration.rb', line 23

def initialize(gem_name)      
  @gem_name         = gem_name
  @summary          = '[ENTER A SUMMARY]'
  @author           = '[ENTER A AUTHOR]'
  @email            = '[ENTER YOUR EMAIL]'
  @url              = ''
  @require_path     = 'lib'
  @version          = "0.1.0"
  @platform         = ::Gem::Platform::RUBY
  @package_filelist = FileList['[a-zA-Z]*', 'bin/**/*', 'lib/**/*', 'spec/**/*']
  @spec_filelist    = FileList['spec/**/*_spec.rb']
  @rdoc_files       = ['README.txt', 'CHANGELOG.txt', "LICENSE.txt", 'lib/**/*.rb']  
  @has_rdoc         = false
  @executables      = []
  @dependencies     = {}
  @runtime_dependencies     = {}
  @development_dependencies = {}
  @outpath = ENV["CC_BUILD_ARTIFACTS"] || default_outpath
  
  unless File.exist?(@outpath)
    FileUtils.mkdir(@outpath) 
  end

  yield self if block_given?

  define_tasks
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def author
  @author
end

#dependenciesObject

Returns the value of attribute dependencies.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def dependencies
  @dependencies
end

#development_dependenciesObject

Returns the value of attribute development_dependencies.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def development_dependencies
  @development_dependencies
end

#emailObject

Returns the value of attribute email.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def email
  @email
end

#executablesObject

Returns the value of attribute executables.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def executables
  @executables
end

#gem_nameObject

Returns the value of attribute gem_name.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def gem_name
  @gem_name
end

#has_rdocObject

Returns the value of attribute has_rdoc.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def has_rdoc
  @has_rdoc
end

#outpathObject

Returns the value of attribute outpath.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def outpath
  @outpath
end

#package_filelistObject

Returns the value of attribute package_filelist.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def package_filelist
  @package_filelist
end

#platformObject

Returns the value of attribute platform.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def platform
  @platform
end

#rdoc_filesObject

Returns the value of attribute rdoc_files.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def rdoc_files
  @rdoc_files
end

#require_pathObject

Returns the value of attribute require_path.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def require_path
  @require_path
end

#runtime_dependenciesObject

Returns the value of attribute runtime_dependencies.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def runtime_dependencies
  @runtime_dependencies
end

#spec_filelistObject

Returns the value of attribute spec_filelist.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def spec_filelist
  @spec_filelist
end

#summaryObject

Returns the value of attribute summary.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def summary
  @summary
end

#urlObject

Returns the value of attribute url.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def url
  @url
end

#versionObject

Returns the value of attribute version.



16
17
18
# File 'lib/rstack/configuration.rb', line 16

def version
  @version
end

Instance Method Details

#define_tasksObject



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/rstack/configuration.rb', line 59

def define_tasks
  RSpec.define_tasks  self
  Gem.define_tasks    self
  RDoc.define_tasks   self if @has_rdoc
        
  task :default => :spec
  task :repackage => :spec
  task :cruise  do
    ::Rake::Task[:repackage].invoke
    ::Rake::Task[:rdoc].invoke if @has_rdoc
  end
end

#filesObject



51
52
53
# File 'lib/rstack/configuration.rb', line 51

def files
  @files ||= filelist_to_cleaned_a @package_filelist
end

#spec_filesObject



55
56
57
# File 'lib/rstack/configuration.rb', line 55

def spec_files
  @spec_files ||= filelist_to_cleaned_a @spec_filelist
end