Class: SocialStream::Release::Global

Inherits:
Object
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/social_stream/release/global.rb,
lib/social_stream/release/global/version_file.rb

Direct Known Subclasses

Component

Defined Under Namespace

Classes: VersionFile

Constant Summary collapse

DEPENDENCY_REGEXP =
/dependency.*social_stream-(\w*)/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target = nil) ⇒ Global

Returns a new instance of Global.



14
15
16
# File 'lib/social_stream/release/global.rb', line 14

def initialize(target = nil)
  @target = target
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



12
13
14
# File 'lib/social_stream/release/global.rb', line 12

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



12
13
14
# File 'lib/social_stream/release/global.rb', line 12

def version
  @version
end

Instance Method Details

#bumpObject



18
19
20
21
22
# File 'lib/social_stream/release/global.rb', line 18

def bump
  bump_version

  update_dependencies
end

#commit_filesObject



33
34
35
# File 'lib/social_stream/release/global.rb', line 33

def commit_files
  "#{ @version_file.filename } #{ gemspec }"
end

#dependenciesObject



28
29
30
31
# File 'lib/social_stream/release/global.rb', line 28

def dependencies
  @dependencies ||=
    File.read(gemspec).scan(DEPENDENCY_REGEXP).flatten
end

#last_tagObject



37
38
39
# File 'lib/social_stream/release/global.rb', line 37

def last_tag
  `git describe`.split('-').first
end

#publishObject



24
25
26
# File 'lib/social_stream/release/global.rb', line 24

def publish
  release_cmd rake_release_command
end