space 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/bin/space CHANGED
@@ -3,4 +3,5 @@
3
3
  $: << 'lib'
4
4
  require 'space'
5
5
 
6
+ abort 'Need to specify a project name' if ARGV.empty?
6
7
  Space::App.run(ARGV[0])
data/lib/space/app.rb CHANGED
@@ -3,22 +3,31 @@ require 'readline'
3
3
  module Space
4
4
  class App
5
5
  class << self
6
- attr_reader :config
6
+ attr_reader :instance
7
7
 
8
8
  def run(name)
9
- @config = Config.load(name)
10
- new(config.name || name).run
9
+ @instance = new(name)
10
+ instance.run
11
+ end
12
+
13
+ def name
14
+ instance.name
15
+ end
16
+
17
+ def config
18
+ instance.config
11
19
  end
12
20
  end
13
21
 
14
22
  include Readline
15
23
 
16
- attr_accessor :screen, :name, :repos, :bundle, :path
24
+ attr_accessor :screen, :name, :config, :repos, :bundle, :path
17
25
 
18
26
  def initialize(name)
19
27
  @screen = Screen.new(self)
20
28
  @name = name
21
- @bundle = Bundle.new(self.class.config.paths.first)
29
+ @config = Config.load(name)
30
+ @bundle = Bundle.new(config.paths.first)
22
31
  @path = File.expand_path('.')
23
32
  end
24
33
 
@@ -31,7 +31,7 @@ module Space
31
31
  end
32
32
 
33
33
  # def name
34
- # "#{App.config.name}-(#{names.join('|').gsub("#{App.config.name}-", '')})"
34
+ # "#{App.name}-(#{names.join('|').gsub("#{App.config.name}-", '')})"
35
35
  # end
36
36
 
37
37
  def find_by_name(name)
@@ -39,7 +39,7 @@ module Space
39
39
  end
40
40
 
41
41
  def self_and_dependencies
42
- self.class.new(map { |repo| [repo.name] + repo.dependencies }.flatten.uniq)
42
+ self.class.new(map { |repo| [repo] + repo.dependencies }.flatten.uniq)
43
43
  end
44
44
  end
45
45
  end
data/lib/space/screen.rb CHANGED
@@ -9,7 +9,10 @@ module Space
9
9
  def render
10
10
  system 'clear'
11
11
  puts render_project
12
- app.repos.each { |repo| puts render_repo(repo) }
12
+ repos = app.repos.scoped? ? app.repos.self_and_dependencies : app.repos
13
+ repos.each do |repo|
14
+ puts render_repo(repo)
15
+ end
13
16
  end
14
17
 
15
18
  private
@@ -1,3 +1,4 @@
1
1
  <%= repo_title %>
2
2
  <%=i git_status %> <%= bundle_status %>
3
3
  <%=i bundle.clean? ? bundle_deps : bundle_info %>
4
+
data/lib/space/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Space
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: space
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-27 00:00:00.000000000 Z
12
+ date: 2012-03-28 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: space.
15
15
  email: