Module: SocialStream::Release

Defined in:
lib/social_stream/release.rb,
lib/social_stream/release/global/release.rb,
lib/social_stream/release/component/release.rb,
lib/social_stream/release/dependency_update.rb,
lib/social_stream/release/global/version_file.rb,
lib/social_stream/release/component/version_file.rb

Defined Under Namespace

Modules: Component, Global Classes: DependencyUpdate

Class Method Summary collapse

Class Method Details

.allObject



41
42
43
# File 'lib/social_stream/release.rb', line 41

def all
  @components + [ @global ]
end

.create(*args) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/social_stream/release.rb', line 4

def create(*args)
  # First of all, update gems
  system "bundle"

  parse_args(args)

  all.each(&:bump_version)

  all.each(&:update_dependencies)

  system("git commit #{ all.map(&:commit_files).join(" ") } -m #{ @global.version }") ||
    raise(RuntimeError.new)

  all.each(&:rake_release)
end

.dependenciesObject



20
21
22
23
# File 'lib/social_stream/release.rb', line 20

def dependencies
  @dependencies ||=
    Global::Release.new.dependencies
end

.parse_args(args) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/social_stream/release.rb', line 25

def parse_args args
  @components = []

  args.each do |a|
    name, version = a.split(":")

    if dependencies.include?(name)
      @components << Component::Release.new(name, version)
    else
      @target = name
    end
  end

  @global = Global::Release.new(@target)
end