popo 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/envy +1 -1
 - data/lib/popo.rb +1 -0
 - data/lib/popo/database.rb +4 -0
 - data/lib/popo/git_utils.rb +0 -1
 - data/lib/popo/initializer.rb +15 -17
 - data/lib/popo/runner.rb +54 -26
 - data/lib/popo/rvm.rb +27 -16
 - data/lib/popo/sync.rb +4 -1
 - data/lib/popo/utils.rb +5 -2
 - data/lib/popo/version.rb +3 -0
 - data/popo.gemspec +2 -2
 - data/script/envyrc +1 -30
 - metadata +48 -70
 
    
        data/bin/envy
    CHANGED
    
    | 
         @@ -7,7 +7,7 @@ ENV_PATH = `which env`.strip 
     | 
|
| 
       7 
7 
     | 
    
         
             
            POPO_PATH = ENV['popo_path'] if ENV.include?('popo_path')
         
     | 
| 
       8 
8 
     | 
    
         
             
            POPO_TARGET = ENV['popo_target'] if ENV.include?('popo_target')
         
     | 
| 
       9 
9 
     | 
    
         
             
            POPO_WORK_PATH = '.manifest'
         
     | 
| 
       10 
     | 
    
         
            -
            ENVYRC = File.join( 
     | 
| 
      
 10 
     | 
    
         
            +
            ENVYRC = File.expand_path(File.join(File.dirname(__FILE__), '../script/envyrc'))
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
            cmd = ARGV.join(' ')
         
     | 
| 
       13 
13 
     | 
    
         | 
    
        data/lib/popo.rb
    CHANGED
    
    
    
        data/lib/popo/database.rb
    CHANGED
    
    
    
        data/lib/popo/git_utils.rb
    CHANGED
    
    
    
        data/lib/popo/initializer.rb
    CHANGED
    
    | 
         @@ -2,18 +2,14 @@ module Popo 
     | 
|
| 
       2 
2 
     | 
    
         
             
              class Initializer
         
     | 
| 
       3 
3 
     | 
    
         
             
                include Constants
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
     | 
    
         
            -
                def self.boot(config, options)
         
     | 
| 
       6 
     | 
    
         
            -
                  self.new(config, options)
         
     | 
| 
      
 5 
     | 
    
         
            +
                def self.boot(config, options, db)
         
     | 
| 
      
 6 
     | 
    
         
            +
                  self.new(config, options, db)
         
     | 
| 
       7 
7 
     | 
    
         
             
                end
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
                def initialize(config, options)
         
     | 
| 
       10 
     | 
    
         
            -
                  @repos = {}
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
                  config['repos'].each do |k, v|
         
     | 
| 
       13 
     | 
    
         
            -
                    @repos[k] = v
         
     | 
| 
       14 
     | 
    
         
            -
                  end
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
      
 9 
     | 
    
         
            +
                def initialize(config, options, db)
         
     | 
| 
       16 
10 
     | 
    
         
             
                  @options = options
         
     | 
| 
      
 11 
     | 
    
         
            +
                  @db = db
         
     | 
| 
      
 12 
     | 
    
         
            +
                  @manifest = config['manifests'][@options[:manifest]]
         
     | 
| 
       17 
13 
     | 
    
         
             
                  @default_target = @options[:target] || 'development'
         
     | 
| 
       18 
14 
     | 
    
         
             
                  @deploy_path = File.absolute_path(@options[:path])
         
     | 
| 
       19 
15 
     | 
    
         
             
                  @location = @options[:location] || nil
         
     | 
| 
         @@ -28,16 +24,18 @@ module Popo 
     | 
|
| 
       28 
24 
     | 
    
         
             
                def setup
         
     | 
| 
       29 
25 
     | 
    
         
             
                  print_variables if @options[:verbose]
         
     | 
| 
       30 
26 
     | 
    
         | 
| 
       31 
     | 
    
         
            -
                   
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
      
 27 
     | 
    
         
            +
                  clone_path = File.join(@deploy_path, POPO_WORK_PATH)
         
     | 
| 
      
 28 
     | 
    
         
            +
                  GitUtils.git_clone(@manifest['git'], clone_path, @manifest['branch'])
         
     | 
| 
       33 
29 
     | 
    
         | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
                      clone_path = File.join(@deploy_path, basename)
         
     | 
| 
       38 
     | 
    
         
            -
                    end
         
     | 
| 
      
 30 
     | 
    
         
            +
                  @db.boot_database
         
     | 
| 
      
 31 
     | 
    
         
            +
                  @db.migrate_database
         
     | 
| 
      
 32 
     | 
    
         
            +
                  repos = @db.get_children("repos")
         
     | 
| 
       39 
33 
     | 
    
         | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
      
 34 
     | 
    
         
            +
                  repos.each do |r|
         
     | 
| 
      
 35 
     | 
    
         
            +
                    git = @db.get("repos.#{r}.git")
         
     | 
| 
      
 36 
     | 
    
         
            +
                    branch = @db.get("repos.#{r}.branch")
         
     | 
| 
      
 37 
     | 
    
         
            +
                    clone_path = File.join(@deploy_path, r)
         
     | 
| 
      
 38 
     | 
    
         
            +
                    GitUtils.git_clone(git, clone_path, branch)
         
     | 
| 
       41 
39 
     | 
    
         
             
                  end
         
     | 
| 
       42 
40 
     | 
    
         | 
| 
       43 
41 
     | 
    
         
             
                  write_config
         
     | 
    
        data/lib/popo/runner.rb
    CHANGED
    
    | 
         @@ -12,9 +12,16 @@ module Popo 
     | 
|
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         
             
                def initialize(args)
         
     | 
| 
       14 
14 
     | 
    
         
             
                  @popo_path = ENV['popo_path'] || Dir.pwd
         
     | 
| 
      
 15 
     | 
    
         
            +
                  Object.const_set("POPO_PATH", @popo_path)
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
       15 
17 
     | 
    
         
             
                  @options = {}
         
     | 
| 
       16 
18 
     | 
    
         
             
                  @cabler_options = {}
         
     | 
| 
       17 
19 
     | 
    
         
             
                  @options[:verbose] = false
         
     | 
| 
      
 20 
     | 
    
         
            +
                  @options[:target] = 'development'
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                  if Utils.has_popo_config?(@popo_path)
         
     | 
| 
      
 23 
     | 
    
         
            +
                    @options[:target] = POPO_CONFIG['target']
         
     | 
| 
      
 24 
     | 
    
         
            +
                  end
         
     | 
| 
       18 
25 
     | 
    
         | 
| 
       19 
26 
     | 
    
         
             
                  optparse = OptionParser.new do |opts|
         
     | 
| 
       20 
27 
     | 
    
         
             
                    opts.banner = "Popo tool."
         
     | 
| 
         @@ -32,6 +39,10 @@ module Popo 
     | 
|
| 
       32 
39 
     | 
    
         
             
                      @options[:user] = user
         
     | 
| 
       33 
40 
     | 
    
         
             
                    end
         
     | 
| 
       34 
41 
     | 
    
         | 
| 
      
 42 
     | 
    
         
            +
                    opts.on('-m', '--manifest MANIFEST', 'Manifest') do |manifest|
         
     | 
| 
      
 43 
     | 
    
         
            +
                      @options[:manifest] = manifest
         
     | 
| 
      
 44 
     | 
    
         
            +
                    end
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
       35 
46 
     | 
    
         
             
                    opts.on('-l', '--location LOCATION', 'Location') do |location|
         
     | 
| 
       36 
47 
     | 
    
         
             
                      @options[:location] = location
         
     | 
| 
       37 
48 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -40,6 +51,11 @@ module Popo 
     | 
|
| 
       40 
51 
     | 
    
         
             
                      @options[:verbose] = true
         
     | 
| 
       41 
52 
     | 
    
         
             
                    end
         
     | 
| 
       42 
53 
     | 
    
         | 
| 
      
 54 
     | 
    
         
            +
                    opts.on('-V', '--version', 'Version') do
         
     | 
| 
      
 55 
     | 
    
         
            +
                      puts Popo::VERSION
         
     | 
| 
      
 56 
     | 
    
         
            +
                      exit
         
     | 
| 
      
 57 
     | 
    
         
            +
                    end
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
       43 
59 
     | 
    
         
             
                    opts.on('-h', '--help', 'Display this screen') do
         
     | 
| 
       44 
60 
     | 
    
         
             
                      puts opts
         
     | 
| 
       45 
61 
     | 
    
         
             
                      exit
         
     | 
| 
         @@ -51,26 +67,42 @@ module Popo 
     | 
|
| 
       51 
67 
     | 
    
         
             
                  if args.length == 0
         
     | 
| 
       52 
68 
     | 
    
         
             
                    Utils.say optparse.help
         
     | 
| 
       53 
69 
     | 
    
         
             
                  else
         
     | 
| 
       54 
     | 
    
         
            -
                     
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
                                     :verbose  => @options[:verbose] }
         
     | 
| 
      
 70 
     | 
    
         
            +
                    Object.const_set("POPO_TARGET", @options[:target])
         
     | 
| 
      
 71 
     | 
    
         
            +
                    Object.const_set("POPO_LOCATION", @options[:location])
         
     | 
| 
      
 72 
     | 
    
         
            +
                    Object.const_set("POPO_USER", @options[:user])
         
     | 
| 
       58 
73 
     | 
    
         | 
| 
       59 
     | 
    
         
            -
                     
     | 
| 
      
 74 
     | 
    
         
            +
                    @cabler_options = { :path  => File.join(@popo_path, POPO_WORK_PATH),
         
     | 
| 
      
 75 
     | 
    
         
            +
                                        :target   => ENV['CABLING_TARGET'] || @options[:target] || 'development',
         
     | 
| 
      
 76 
     | 
    
         
            +
                                        :location => ENV['CABLING_LOCATION'] || @options[:location],
         
     | 
| 
      
 77 
     | 
    
         
            +
                                        :verbose  => @options[:verbose]
         
     | 
| 
      
 78 
     | 
    
         
            +
                                      }
         
     | 
| 
      
 79 
     | 
    
         
            +
                    self.run(args)
         
     | 
| 
       60 
80 
     | 
    
         
             
                  end
         
     | 
| 
       61 
81 
     | 
    
         
             
                end
         
     | 
| 
       62 
82 
     | 
    
         | 
| 
       63 
83 
     | 
    
         
             
                def run(args)
         
     | 
| 
       64 
84 
     | 
    
         
             
                  case args.shift
         
     | 
| 
       65 
85 
     | 
    
         
             
                  when 'init'
         
     | 
| 
      
 86 
     | 
    
         
            +
                    config = get_config!
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
                    if !@options[:manifest].nil?
         
     | 
| 
      
 89 
     | 
    
         
            +
                      if config['manifests'][@options[:manifest]].nil?
         
     | 
| 
      
 90 
     | 
    
         
            +
                        raise "manifest #{@options[:manifest]} does not exist in #{DEFAULT_CONFIG_FILE}!"
         
     | 
| 
      
 91 
     | 
    
         
            +
                      end
         
     | 
| 
      
 92 
     | 
    
         
            +
                    else
         
     | 
| 
      
 93 
     | 
    
         
            +
                      raise "manifest (-m) option needed!"
         
     | 
| 
      
 94 
     | 
    
         
            +
                    end
         
     | 
| 
      
 95 
     | 
    
         
            +
             
     | 
| 
       66 
96 
     | 
    
         
             
                    if !@options[:path].nil?
         
     | 
| 
       67 
97 
     | 
    
         
             
                      if !File.exist?(File.join(@popo_path, @options[:path]))
         
     | 
| 
       68 
     | 
    
         
            -
                         
     | 
| 
      
 98 
     | 
    
         
            +
                        @cabler_options[:path] = File.join(@popo_path, @options[:path], POPO_WORK_PATH)
         
     | 
| 
      
 99 
     | 
    
         
            +
                        db = Database.new(@popo_path, @cabler_options)
         
     | 
| 
      
 100 
     | 
    
         
            +
                        Initializer.boot(config, @options, db).setup
         
     | 
| 
       69 
101 
     | 
    
         
             
                      else
         
     | 
| 
       70 
102 
     | 
    
         
             
                        raise "Path already exists!"
         
     | 
| 
       71 
103 
     | 
    
         
             
                      end
         
     | 
| 
       72 
104 
     | 
    
         
             
                    else
         
     | 
| 
       73 
     | 
    
         
            -
                      raise " 
     | 
| 
      
 105 
     | 
    
         
            +
                      raise "path (-p) option needed!"
         
     | 
| 
       74 
106 
     | 
    
         
             
                    end
         
     | 
| 
       75 
107 
     | 
    
         
             
                  when 'sync'
         
     | 
| 
       76 
108 
     | 
    
         
             
                    if Utils.in_popo?(@popo_path)
         
     | 
| 
         @@ -81,16 +113,9 @@ module Popo 
     | 
|
| 
       81 
113 
     | 
    
         
             
                    end
         
     | 
| 
       82 
114 
     | 
    
         
             
                  when 'rvminstall'
         
     | 
| 
       83 
115 
     | 
    
         
             
                    if Utils.in_popo?(@popo_path)
         
     | 
| 
       84 
     | 
    
         
            -
                       
     | 
| 
       85 
     | 
    
         
            -
             
     | 
| 
       86 
     | 
    
         
            -
                       
     | 
| 
       87 
     | 
    
         
            -
                      if ok == 'y'
         
     | 
| 
       88 
     | 
    
         
            -
                        db = Database.new(@popo_path, @cabler_options)
         
     | 
| 
       89 
     | 
    
         
            -
                        db.boot_database
         
     | 
| 
       90 
     | 
    
         
            -
                        RVM.new(@popo_path, args, db).setup
         
     | 
| 
       91 
     | 
    
         
            -
                      else
         
     | 
| 
       92 
     | 
    
         
            -
                        Utils.say "y/N only!"
         
     | 
| 
       93 
     | 
    
         
            -
                      end
         
     | 
| 
      
 116 
     | 
    
         
            +
                      db = Database.new(@popo_path, @cabler_options)
         
     | 
| 
      
 117 
     | 
    
         
            +
                      db.boot_database
         
     | 
| 
      
 118 
     | 
    
         
            +
                      RVM.new(@popo_path, args, db).setup
         
     | 
| 
       94 
119 
     | 
    
         
             
                    end
         
     | 
| 
       95 
120 
     | 
    
         
             
                  when 'migrate'
         
     | 
| 
       96 
121 
     | 
    
         
             
                    if Utils.in_popo?(@popo_path)
         
     | 
| 
         @@ -110,18 +135,21 @@ module Popo 
     | 
|
| 
       110 
135 
     | 
    
         
             
                end
         
     | 
| 
       111 
136 
     | 
    
         | 
| 
       112 
137 
     | 
    
         
             
                def bash!
         
     | 
| 
       113 
     | 
    
         
            -
                  Utils. 
     | 
| 
      
 138 
     | 
    
         
            +
                  if Utils.has_popo_config?(Dir.pwd)
         
     | 
| 
       114 
139 
     | 
    
         | 
| 
       115 
     | 
    
         
            -
             
     | 
| 
       116 
     | 
    
         
            -
             
     | 
| 
       117 
     | 
    
         
            -
             
     | 
| 
       118 
     | 
    
         
            -
             
     | 
| 
      
 140 
     | 
    
         
            +
                    poporc_path = File.join(Dir.pwd, POPO_WORK_PATH, POPORC)
         
     | 
| 
      
 141 
     | 
    
         
            +
                    target = POPO_CONFIG['target']
         
     | 
| 
      
 142 
     | 
    
         
            +
                    path = POPO_CONFIG['path']
         
     | 
| 
      
 143 
     | 
    
         
            +
                    location = POPO_CONFIG['location']
         
     | 
| 
       119 
144 
     | 
    
         | 
| 
       120 
     | 
    
         
            -
             
     | 
| 
       121 
     | 
    
         
            -
             
     | 
| 
       122 
     | 
    
         
            -
             
     | 
| 
      
 145 
     | 
    
         
            +
                    bashcmd = "%s popo_target=%s popo_path=%s \
         
     | 
| 
      
 146 
     | 
    
         
            +
                              popo_location=%s %s --rcfile %s" \
         
     | 
| 
      
 147 
     | 
    
         
            +
                              % [ENV_CMD, target, path, location, BASH_CMD, poporc_path]
         
     | 
| 
       123 
148 
     | 
    
         | 
| 
       124 
     | 
    
         
            -
             
     | 
| 
      
 149 
     | 
    
         
            +
                    exec(bashcmd)
         
     | 
| 
      
 150 
     | 
    
         
            +
                  else
         
     | 
| 
      
 151 
     | 
    
         
            +
                    raise "#{POPO_YML_FILE} not found or it may be wrong!"
         
     | 
| 
      
 152 
     | 
    
         
            +
                  end
         
     | 
| 
       125 
153 
     | 
    
         
             
                end
         
     | 
| 
       126 
154 
     | 
    
         | 
| 
       127 
155 
     | 
    
         
             
                def get_config!
         
     | 
    
        data/lib/popo/rvm.rb
    CHANGED
    
    | 
         @@ -8,12 +8,15 @@ module Popo 
     | 
|
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
                  @rubies = @db.get("rvm.rubies").split(",")
         
     | 
| 
       10 
10 
     | 
    
         
             
                  @default_ruby = @db.get("rvm.ruby.default")
         
     | 
| 
       11 
     | 
    
         
            -
                  @default_gems = @db. 
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
      
 11 
     | 
    
         
            +
                  @default_gems = @db.get_children("rvm.gems.default")
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                  if @db.has_key?("rvm.gems.source")
         
     | 
| 
      
 14 
     | 
    
         
            +
                    @default_gem_source = @db.get("rvm.gems.source")
         
     | 
| 
      
 15 
     | 
    
         
            +
                  end
         
     | 
| 
       13 
16 
     | 
    
         
             
                end
         
     | 
| 
       14 
17 
     | 
    
         | 
| 
       15 
18 
     | 
    
         
             
                def setup
         
     | 
| 
       16 
     | 
    
         
            -
                  Utils.say "Rubies to be installed #{@rubies}...\n 
     | 
| 
      
 19 
     | 
    
         
            +
                  Utils.say "Rubies to be installed #{@rubies}...\n"
         
     | 
| 
       17 
20 
     | 
    
         | 
| 
       18 
21 
     | 
    
         
             
                  @rubies.each do |r|
         
     | 
| 
       19 
22 
     | 
    
         
             
                    patch = File.join(@app_root, 'rvm', "#{r}.patch")
         
     | 
| 
         @@ -26,6 +29,7 @@ module Popo 
     | 
|
| 
       26 
29 
     | 
    
         
             
                    end
         
     | 
| 
       27 
30 
     | 
    
         | 
| 
       28 
31 
     | 
    
         
             
                    system(cmd)
         
     | 
| 
      
 32 
     | 
    
         
            +
                    install_default_gems(r)
         
     | 
| 
       29 
33 
     | 
    
         
             
                  end
         
     | 
| 
       30 
34 
     | 
    
         | 
| 
       31 
35 
     | 
    
         
             
                  Utils.say_with_time "Setting #{@default_ruby} as default ruby..." do
         
     | 
| 
         @@ -33,27 +37,34 @@ module Popo 
     | 
|
| 
       33 
37 
     | 
    
         
             
                  end
         
     | 
| 
       34 
38 
     | 
    
         | 
| 
       35 
39 
     | 
    
         
             
                  Utils.say(POST_INSTALL_NOTE)
         
     | 
| 
      
 40 
     | 
    
         
            +
                end
         
     | 
| 
       36 
41 
     | 
    
         | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
      
 42 
     | 
    
         
            +
                def install_default_gems(ruby_version)
         
     | 
| 
      
 43 
     | 
    
         
            +
                  gem_source = ''
         
     | 
| 
      
 44 
     | 
    
         
            +
                  gem_bin = File.join(@app_root, 'rvm', 'bin', "gem-#{ruby_version}")
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
                  @default_gems.each do |g|
         
     | 
| 
      
 47 
     | 
    
         
            +
                    if @db.has_key?("rvm.gems.default.#{g}.source")
         
     | 
| 
      
 48 
     | 
    
         
            +
                      gem_source = @db.get("rvm.gems.default.#{g}.source")
         
     | 
| 
      
 49 
     | 
    
         
            +
                    end
         
     | 
| 
       40 
50 
     | 
    
         | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
       43 
     | 
    
         
            -
             
     | 
| 
       44 
     | 
    
         
            -
            # 
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
      
 51 
     | 
    
         
            +
                    if !gem_source.empty?
         
     | 
| 
      
 52 
     | 
    
         
            +
                     gem_cmd = "#{gem_bin} install #{g} --source #{gem_source} --no-ri --no-rdoc"
         
     | 
| 
      
 53 
     | 
    
         
            +
                    elsif !@default_gem_source.empty?
         
     | 
| 
      
 54 
     | 
    
         
            +
                     gem_cmd = "#{gem_bin} install #{g} --source #{@default_gem_source} --no-ri --no-rdoc"
         
     | 
| 
      
 55 
     | 
    
         
            +
                    else
         
     | 
| 
      
 56 
     | 
    
         
            +
                     gem_cmd = "#{gem_bin} install #{g} --no-ri --no-rdoc"
         
     | 
| 
      
 57 
     | 
    
         
            +
                    end
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
                    system(gem_cmd)
         
     | 
| 
      
 60 
     | 
    
         
            +
                  end
         
     | 
| 
       46 
61 
     | 
    
         
             
                end
         
     | 
| 
       47 
62 
     | 
    
         
             
              end
         
     | 
| 
       48 
63 
     | 
    
         | 
| 
       49 
64 
     | 
    
         
             
            POST_INSTALL_NOTE = <<NOTE
         
     | 
| 
       50 
     | 
    
         
            -
            You're almost done!\n 
     | 
| 
      
 65 
     | 
    
         
            +
            You're almost done!\n
         
     | 
| 
       51 
66 
     | 
    
         
             
            Do the following inside popo:\n
         
     | 
| 
       52 
67 
     | 
    
         
             
            1. rvm reload\n
         
     | 
| 
       53 
     | 
    
         
            -
            2. gem install cableguy popo dbget_client --source http://gems.caresharing.eu --no-ri --no-rdoc\n\n
         
     | 
| 
       54 
     | 
    
         
            -
            OPTIONAL: (If you use another ruby version). In this example, ree.\n
         
     | 
| 
       55 
     | 
    
         
            -
            1. rvm use ree-1.8.7-2011.03\n
         
     | 
| 
       56 
     | 
    
         
            -
            2. gem install cableguy popo dbget_client --source http://gems.caresharing.eu --no-ri --no-rdoc\n
         
     | 
| 
       57 
68 
     | 
    
         
             
            NOTE
         
     | 
| 
       58 
69 
     | 
    
         | 
| 
       59 
70 
     | 
    
         
             
            end
         
     | 
    
        data/lib/popo/sync.rb
    CHANGED
    
    | 
         @@ -1,5 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module Popo
         
     | 
| 
       2 
2 
     | 
    
         
             
              class Sync
         
     | 
| 
      
 3 
     | 
    
         
            +
                include Constants
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
       3 
5 
     | 
    
         
             
                def initialize(app_root, args, db)
         
     | 
| 
       4 
6 
     | 
    
         
             
                  @db = db
         
     | 
| 
       5 
7 
     | 
    
         
             
                  @current_dir = File.basename(Dir.pwd)
         
     | 
| 
         @@ -27,7 +29,7 @@ module Popo 
     | 
|
| 
       27 
29 
     | 
    
         | 
| 
       28 
30 
     | 
    
         
             
                  if @repos.empty?
         
     | 
| 
       29 
31 
     | 
    
         
             
                    if @cwd.eql? @app_root
         
     | 
| 
       30 
     | 
    
         
            -
                      popo_folders = @db.get(" 
     | 
| 
      
 32 
     | 
    
         
            +
                      popo_folders = @db.get("sync.directories").split(',')
         
     | 
| 
       31 
33 
     | 
    
         
             
                      popo_folders.each { |p| gather_many(p) }
         
     | 
| 
       32 
34 
     | 
    
         
             
                    else
         
     | 
| 
       33 
35 
     | 
    
         
             
                      repo = File.basename(@cwd)
         
     | 
| 
         @@ -54,6 +56,7 @@ module Popo 
     | 
|
| 
       54 
56 
     | 
    
         
             
                  if !File.exists?(@info[:path])
         
     | 
| 
       55 
57 
     | 
    
         
             
                    GitUtils.git_clone(@info[:host], @info[:path], @info[:branch])
         
     | 
| 
       56 
58 
     | 
    
         
             
                  else
         
     | 
| 
      
 59 
     | 
    
         
            +
                    GitUtils.git_stash(@info[:path]) if POPO_CONFIG['target'] == 'development'
         
     | 
| 
       57 
60 
     | 
    
         
             
                    GitUtils.git_update(@info[:path], @info[:branch])
         
     | 
| 
       58 
61 
     | 
    
         
             
                  end
         
     | 
| 
       59 
62 
     | 
    
         
             
                end
         
     | 
    
        data/lib/popo/utils.rb
    CHANGED
    
    | 
         @@ -24,7 +24,7 @@ module Popo 
     | 
|
| 
       24 
24 
     | 
    
         
             
                  true
         
     | 
| 
       25 
25 
     | 
    
         
             
                end
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
                def self. 
     | 
| 
      
 27 
     | 
    
         
            +
                def self.has_popo_config?(root_path)
         
     | 
| 
       28 
28 
     | 
    
         
             
                  popo_work_path = File.expand_path(File.join(root_path, POPO_WORK_PATH))
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         
             
                  popo_yml = File.expand_path(File.join(popo_work_path, POPO_YML_FILE))
         
     | 
| 
         @@ -37,8 +37,11 @@ module Popo 
     | 
|
| 
       37 
37 
     | 
    
         
             
                    else
         
     | 
| 
       38 
38 
     | 
    
         
             
                      raise "#{POPO_WORK_PATH}/#{POPO_YML_FILE} seems to be wrong."
         
     | 
| 
       39 
39 
     | 
    
         
             
                    end
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                    true
         
     | 
| 
       40 
42 
     | 
    
         
             
                  else
         
     | 
| 
       41 
     | 
    
         
            -
                     
     | 
| 
      
 43 
     | 
    
         
            +
                    false
         
     | 
| 
      
 44 
     | 
    
         
            +
            #        raise "#{POPO_YML_FILE} not found."
         
     | 
| 
       42 
45 
     | 
    
         
             
                  end
         
     | 
| 
       43 
46 
     | 
    
         
             
                end
         
     | 
| 
       44 
47 
     | 
    
         
             
              end
         
     | 
    
        data/lib/popo/version.rb
    ADDED
    
    
    
        data/popo.gemspec
    CHANGED
    
    | 
         @@ -1,10 +1,10 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # -*- encoding: utf-8 -*-
         
     | 
| 
       2 
2 
     | 
    
         
             
            $:.push File.expand_path("../lib", __FILE__)
         
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
      
 3 
     | 
    
         
            +
            require 'popo/version'
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       6 
6 
     | 
    
         
             
              s.name        = "popo"
         
     | 
| 
       7 
     | 
    
         
            -
              s.version     = VERSION
         
     | 
| 
      
 7 
     | 
    
         
            +
              s.version     = Popo::VERSION
         
     | 
| 
       8 
8 
     | 
    
         
             
              s.authors     = ["Jan Mendoza"]
         
     | 
| 
       9 
9 
     | 
    
         
             
              s.email       = ["poymode@gmail.com"]
         
     | 
| 
       10 
10 
     | 
    
         
             
              s.homepage    = ""
         
     | 
    
        data/script/envyrc
    CHANGED
    
    | 
         @@ -4,11 +4,9 @@ 
     | 
|
| 
       4 
4 
     | 
    
         
             
            unset $(env | awk -F= '/^rvm_/{print $1" "}')
         
     | 
| 
       5 
5 
     | 
    
         
             
            export rvm_reload_flag=1
         
     | 
| 
       6 
6 
     | 
    
         
             
            export rvm_prefix=$popo_path
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
      
 7 
     | 
    
         
            +
            export rvm_path=$popo_path/rvm
         
     | 
| 
       9 
8 
     | 
    
         
             
            # Now let's load rvm inside popo
         
     | 
| 
       10 
9 
     | 
    
         
             
            source $rvm_prefix/rvm/scripts/rvm
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
10 
     | 
    
         
             
            # Load default rvm
         
     | 
| 
       13 
11 
     | 
    
         
             
            rvm default 1>/dev/null 2>&1
         
     | 
| 
       14 
12 
     | 
    
         
             
            unset PALMADE_GEMS_DIR
         
     | 
| 
         @@ -16,30 +14,3 @@ export PATH="$popo_path/rvm/bin:$popo_path/tools:$PATH" 
     | 
|
| 
       16 
14 
     | 
    
         
             
            export CABLING_PATH=$popo_path/.popo/cabling.yml
         
     | 
| 
       17 
15 
     | 
    
         
             
            export CABLING_TARGET=$popo_target
         
     | 
| 
       18 
16 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
            # this section is for backup
         
     | 
| 
       20 
     | 
    
         
            -
            #unset PALMADE_GEMS_DIR
         
     | 
| 
       21 
     | 
    
         
            -
            #unset rvm_loaded_flag
         
     | 
| 
       22 
     | 
    
         
            -
            #rvm_loaded_flag=1
         
     | 
| 
       23 
     | 
    
         
            -
            #export PATH="$popo_path/rvm/bin:$popo_path/tools:$PATH"
         
     | 
| 
       24 
     | 
    
         
            -
            #export rvm_prefix=$popo_path
         
     | 
| 
       25 
     | 
    
         
            -
            #export rvm_path=$popo_path/rvm
         
     | 
| 
       26 
     | 
    
         
            -
            #export rvm_scripts_path=$rvm_path/scripts
         
     | 
| 
       27 
     | 
    
         
            -
            #export rvm_archives_path=$rvm_path/archives
         
     | 
| 
       28 
     | 
    
         
            -
            #export rvm_src_path=$rvm_path/src
         
     | 
| 
       29 
     | 
    
         
            -
            #export rvm_log_path=$rvm_path/log
         
     | 
| 
       30 
     | 
    
         
            -
            #export rvm_bin_path=$rvm_path/bin
         
     | 
| 
       31 
     | 
    
         
            -
            #export rvm_gems_path=$rvm_path/gems
         
     | 
| 
       32 
     | 
    
         
            -
            #export rvm_hooks_path=$rvm_path/hooks
         
     | 
| 
       33 
     | 
    
         
            -
            #export rvm_tmp_path=$rvm_path/tmp
         
     | 
| 
       34 
     | 
    
         
            -
            #export rvm_gemsets_path=$rvm_path/gemsets
         
     | 
| 
       35 
     | 
    
         
            -
            #export rvm_bin_path=$rvm_path/bin
         
     | 
| 
       36 
     | 
    
         
            -
            #export rvm_patchsets_path=$rvm_path/patchsets
         
     | 
| 
       37 
     | 
    
         
            -
            #export rvm_patches_path=$rvm_path/patches
         
     | 
| 
       38 
     | 
    
         
            -
            #export rvm_gems_cache_path=$rvm_path/gems/cache
         
     | 
| 
       39 
     | 
    
         
            -
            #export rvm_config_path=$rvm_path/config
         
     | 
| 
       40 
     | 
    
         
            -
            #export rvm_rubies_path=$rvm_path/rubies
         
     | 
| 
       41 
     | 
    
         
            -
            #export rvm_gems_path=$rvm_path/gems
         
     | 
| 
       42 
     | 
    
         
            -
            #export rvm_repo_path=$rvm_path/repos
         
     | 
| 
       43 
     | 
    
         
            -
            #unset rvm_loaded_flag
         
     | 
| 
       44 
     | 
    
         
            -
            #source $rvm_scripts_path/rvm
         
     | 
| 
       45 
     | 
    
         
            -
            #rvm default 1>/dev/null 2>&1
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,72 +1,58 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            --- !ruby/object:Gem::Specification 
     | 
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: popo
         
     | 
| 
       3 
     | 
    
         
            -
            version: !ruby/object:Gem::Version 
     | 
| 
       4 
     | 
    
         
            -
               
     | 
| 
       5 
     | 
    
         
            -
               
     | 
| 
       6 
     | 
    
         
            -
              - 0
         
     | 
| 
       7 
     | 
    
         
            -
              - 1
         
     | 
| 
       8 
     | 
    
         
            -
              - 1
         
     | 
| 
       9 
     | 
    
         
            -
              version: 0.1.1
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.4
         
     | 
| 
      
 5 
     | 
    
         
            +
              prerelease: 
         
     | 
| 
       10 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       11 
     | 
    
         
            -
            authors: 
     | 
| 
      
 7 
     | 
    
         
            +
            authors:
         
     | 
| 
       12 
8 
     | 
    
         
             
            - Jan Mendoza
         
     | 
| 
       13 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       14 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       15 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
            dependencies: 
         
     | 
| 
       20 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2012-01-10 00:00:00.000000000Z
         
     | 
| 
      
 13 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 14 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
       21 
15 
     | 
    
         
             
              name: sequel
         
     | 
| 
       22 
     | 
    
         
            -
               
     | 
| 
       23 
     | 
    
         
            -
              requirement: &id001 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 16 
     | 
    
         
            +
              requirement: &22157620 !ruby/object:Gem::Requirement
         
     | 
| 
       24 
17 
     | 
    
         
             
                none: false
         
     | 
| 
       25 
     | 
    
         
            -
                requirements: 
     | 
| 
       26 
     | 
    
         
            -
                - -  
     | 
| 
       27 
     | 
    
         
            -
                  - !ruby/object:Gem::Version 
     | 
| 
       28 
     | 
    
         
            -
                     
     | 
| 
       29 
     | 
    
         
            -
                    - 0
         
     | 
| 
       30 
     | 
    
         
            -
                    version: "0"
         
     | 
| 
      
 18 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 19 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 20 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 21 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
       31 
22 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       32 
     | 
    
         
            -
              version_requirements: *id001
         
     | 
| 
       33 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       34 
     | 
    
         
            -
              name: sqlite3
         
     | 
| 
       35 
23 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       36 
     | 
    
         
            -
               
     | 
| 
      
 24 
     | 
    
         
            +
              version_requirements: *22157620
         
     | 
| 
      
 25 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 26 
     | 
    
         
            +
              name: sqlite3
         
     | 
| 
      
 27 
     | 
    
         
            +
              requirement: &22157000 !ruby/object:Gem::Requirement
         
     | 
| 
       37 
28 
     | 
    
         
             
                none: false
         
     | 
| 
       38 
     | 
    
         
            -
                requirements: 
     | 
| 
       39 
     | 
    
         
            -
                - -  
     | 
| 
       40 
     | 
    
         
            -
                  - !ruby/object:Gem::Version 
     | 
| 
       41 
     | 
    
         
            -
                     
     | 
| 
       42 
     | 
    
         
            -
                    - 0
         
     | 
| 
       43 
     | 
    
         
            -
                    version: "0"
         
     | 
| 
      
 29 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 30 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 31 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 32 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
       44 
33 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       45 
     | 
    
         
            -
              version_requirements: *id002
         
     | 
| 
       46 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       47 
     | 
    
         
            -
              name: cableguy
         
     | 
| 
       48 
34 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       49 
     | 
    
         
            -
               
     | 
| 
      
 35 
     | 
    
         
            +
              version_requirements: *22157000
         
     | 
| 
      
 36 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 37 
     | 
    
         
            +
              name: cableguy
         
     | 
| 
      
 38 
     | 
    
         
            +
              requirement: &22156360 !ruby/object:Gem::Requirement
         
     | 
| 
       50 
39 
     | 
    
         
             
                none: false
         
     | 
| 
       51 
     | 
    
         
            -
                requirements: 
     | 
| 
       52 
     | 
    
         
            -
                - -  
     | 
| 
       53 
     | 
    
         
            -
                  - !ruby/object:Gem::Version 
     | 
| 
       54 
     | 
    
         
            -
                     
     | 
| 
       55 
     | 
    
         
            -
                    - 0
         
     | 
| 
       56 
     | 
    
         
            -
                    version: "0"
         
     | 
| 
      
 40 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 41 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 42 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 43 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
       57 
44 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       58 
     | 
    
         
            -
               
     | 
| 
      
 45 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 46 
     | 
    
         
            +
              version_requirements: *22156360
         
     | 
| 
       59 
47 
     | 
    
         
             
            description: Ruby and rails repo tool
         
     | 
| 
       60 
     | 
    
         
            -
            email: 
     | 
| 
      
 48 
     | 
    
         
            +
            email:
         
     | 
| 
       61 
49 
     | 
    
         
             
            - poymode@gmail.com
         
     | 
| 
       62 
     | 
    
         
            -
            executables: 
     | 
| 
      
 50 
     | 
    
         
            +
            executables:
         
     | 
| 
       63 
51 
     | 
    
         
             
            - envy
         
     | 
| 
       64 
52 
     | 
    
         
             
            - popo
         
     | 
| 
       65 
53 
     | 
    
         
             
            extensions: []
         
     | 
| 
       66 
     | 
    
         
            -
             
     | 
| 
       67 
54 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       68 
     | 
    
         
            -
             
     | 
| 
       69 
     | 
    
         
            -
            files: 
         
     | 
| 
      
 55 
     | 
    
         
            +
            files:
         
     | 
| 
       70 
56 
     | 
    
         
             
            - .gitignore
         
     | 
| 
       71 
57 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       72 
58 
     | 
    
         
             
            - README
         
     | 
| 
         @@ -85,6 +71,7 @@ files: 
     | 
|
| 
       85 
71 
     | 
    
         
             
            - lib/popo/rvm.rb
         
     | 
| 
       86 
72 
     | 
    
         
             
            - lib/popo/sync.rb
         
     | 
| 
       87 
73 
     | 
    
         
             
            - lib/popo/utils.rb
         
     | 
| 
      
 74 
     | 
    
         
            +
            - lib/popo/version.rb
         
     | 
| 
       88 
75 
     | 
    
         
             
            - lib/templates/envy.yml
         
     | 
| 
       89 
76 
     | 
    
         
             
            - popo.gemspec
         
     | 
| 
       90 
77 
     | 
    
         
             
            - script/Rakefile
         
     | 
| 
         @@ -97,37 +84,28 @@ files: 
     | 
|
| 
       97 
84 
     | 
    
         
             
            - targets/production.rb
         
     | 
| 
       98 
85 
     | 
    
         
             
            - targets/staging.rb
         
     | 
| 
       99 
86 
     | 
    
         
             
            - targets/test.rb
         
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
            homepage: ""
         
     | 
| 
      
 87 
     | 
    
         
            +
            homepage: ''
         
     | 
| 
       102 
88 
     | 
    
         
             
            licenses: []
         
     | 
| 
       103 
     | 
    
         
            -
             
     | 
| 
       104 
89 
     | 
    
         
             
            post_install_message: 
         
     | 
| 
       105 
90 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       106 
     | 
    
         
            -
             
     | 
| 
       107 
     | 
    
         
            -
            require_paths: 
         
     | 
| 
      
 91 
     | 
    
         
            +
            require_paths:
         
     | 
| 
       108 
92 
     | 
    
         
             
            - lib
         
     | 
| 
       109 
     | 
    
         
            -
            required_ruby_version: !ruby/object:Gem::Requirement 
     | 
| 
      
 93 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
       110 
94 
     | 
    
         
             
              none: false
         
     | 
| 
       111 
     | 
    
         
            -
              requirements: 
     | 
| 
       112 
     | 
    
         
            -
              - -  
     | 
| 
       113 
     | 
    
         
            -
                - !ruby/object:Gem::Version 
     | 
| 
       114 
     | 
    
         
            -
                   
     | 
| 
       115 
     | 
    
         
            -
             
     | 
| 
       116 
     | 
    
         
            -
                  version: "0"
         
     | 
| 
       117 
     | 
    
         
            -
            required_rubygems_version: !ruby/object:Gem::Requirement 
         
     | 
| 
      
 95 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 96 
     | 
    
         
            +
              - - ! '>='
         
     | 
| 
      
 97 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 98 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 99 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       118 
100 
     | 
    
         
             
              none: false
         
     | 
| 
       119 
     | 
    
         
            -
              requirements: 
     | 
| 
       120 
     | 
    
         
            -
              - -  
     | 
| 
       121 
     | 
    
         
            -
                - !ruby/object:Gem::Version 
     | 
| 
       122 
     | 
    
         
            -
                   
     | 
| 
       123 
     | 
    
         
            -
                  - 0
         
     | 
| 
       124 
     | 
    
         
            -
                  version: "0"
         
     | 
| 
      
 101 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 102 
     | 
    
         
            +
              - - ! '>='
         
     | 
| 
      
 103 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 104 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
       125 
105 
     | 
    
         
             
            requirements: []
         
     | 
| 
       126 
     | 
    
         
            -
             
     | 
| 
       127 
106 
     | 
    
         
             
            rubyforge_project: popo
         
     | 
| 
       128 
     | 
    
         
            -
            rubygems_version: 1. 
     | 
| 
      
 107 
     | 
    
         
            +
            rubygems_version: 1.8.10
         
     | 
| 
       129 
108 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       130 
109 
     | 
    
         
             
            specification_version: 3
         
     | 
| 
       131 
110 
     | 
    
         
             
            summary: Popo ruby and rails repo tool
         
     | 
| 
       132 
111 
     | 
    
         
             
            test_files: []
         
     | 
| 
       133 
     | 
    
         
            -
             
     |