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:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rstack/configuration.rb', line 9

def initialize(gem_name)
  @gem_name         = gem_name
  @summary          = '[ENTER A SUMMARY]'
  @author           = '[ENTER A AUTHOR]'
  @email            = '[ENTER YOUR EMAIL]'
  @url              = '[ENTER A PROJECT 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     = {}

  @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.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def author
  @author
end

#dependenciesObject

Returns the value of attribute dependencies.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def dependencies
  @dependencies
end

#emailObject

Returns the value of attribute email.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def email
  @email
end

#executablesObject

Returns the value of attribute executables.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def executables
  @executables
end

#gem_nameObject

Returns the value of attribute gem_name.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def gem_name
  @gem_name
end

#has_rdocObject

Returns the value of attribute has_rdoc.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def has_rdoc
  @has_rdoc
end

#outpathObject

Returns the value of attribute outpath.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def outpath
  @outpath
end

#package_filelistObject

Returns the value of attribute package_filelist.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def package_filelist
  @package_filelist
end

#platformObject

Returns the value of attribute platform.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def platform
  @platform
end

#rdoc_filesObject

Returns the value of attribute rdoc_files.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def rdoc_files
  @rdoc_files
end

#require_pathObject

Returns the value of attribute require_path.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def require_path
  @require_path
end

#spec_filelistObject

Returns the value of attribute spec_filelist.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def spec_filelist
  @spec_filelist
end

#summaryObject

Returns the value of attribute summary.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def summary
  @summary
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def url
  @url
end

#versionObject

Returns the value of attribute version.



3
4
5
# File 'lib/rstack/configuration.rb', line 3

def version
  @version
end

Instance Method Details

#define_tasksObject



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/rstack/configuration.rb', line 44

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

#filesObject



36
37
38
# File 'lib/rstack/configuration.rb', line 36

def files
  @files ||= filelist_to_cleaned_a @package_filelist
end

#spec_filesObject



40
41
42
# File 'lib/rstack/configuration.rb', line 40

def spec_files
  @spec_files ||= filelist_to_cleaned_a @spec_filelist
end