teapot 0.8.0 → 0.8.1
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.
- checksums.yaml +8 -8
 - data/bin/teapot +26 -5
 - data/lib/teapot/context.rb +2 -1
 - data/lib/teapot/controller/fetch.rb +5 -1
 - data/lib/teapot/controller/list.rb +2 -0
 - data/lib/teapot/controller/run.rb +1 -1
 - data/lib/teapot/loader.rb +5 -5
 - data/lib/teapot/version.rb +1 -1
 - data/test/teapot.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                YjBiNDRhMDhhMjJiYzRhYmZlMDg3ZTM0ZTIwOTY0MmViNzllODA3Mg==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                NTBhNjgxOTg4OWRiYTY5ZjA5Y2ZhZmQwYTI5YTQzYTEzYzY1ZDkxOA==
         
     | 
| 
       7 
7 
     | 
    
         
             
            !binary "U0hBNTEy":
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                YmFlN2NmMjRjYmMwZGYyNzJlZWI4MjVjNDZiNjVkOTc2NmI4OTA1MzdmNWFj
         
     | 
| 
      
 10 
     | 
    
         
            +
                MzkzYjE3ZjY4NjRlNjNlZGIwOTYxYmFhZTJmYmNhNDU0NjYzZGY0ZGM2OTRl
         
     | 
| 
      
 11 
     | 
    
         
            +
                NGIwYjA1MWVlY2YyODgwMGJkNWMzZDNkZjUyZDJhY2E3YjBlMTk=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                YWU4YjJhZjE5NWRlZjRmZTAxNjVlOWIzMmMxMGMzZDgxNzQ5YWJhZGM2MzRm
         
     | 
| 
      
 14 
     | 
    
         
            +
                N2Q4YmUyY2QyNGM3MWRkM2UwOTdlM2ZlYjEwODI0NTQ4NjBlNGE4ODczNzEy
         
     | 
| 
      
 15 
     | 
    
         
            +
                ZmU3YmM4NTNmMjYxN2YxZThiNjVkZWZlZmM2YTA0ZTYxNDliYTQ=
         
     | 
    
        data/bin/teapot
    CHANGED
    
    | 
         @@ -29,12 +29,13 @@ require 'teapot/controller/generate' 
     | 
|
| 
       29 
29 
     | 
    
         
             
            require 'teapot/controller/list'
         
     | 
| 
       30 
30 
     | 
    
         
             
            require 'teapot/controller/run'
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
       32 
     | 
    
         
            -
            require ' 
     | 
| 
      
 32 
     | 
    
         
            +
            require 'time'
         
     | 
| 
       33 
33 
     | 
    
         
             
            require 'trollop'
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
35 
     | 
    
         
             
            OPTIONS = Trollop::options do
         
     | 
| 
       36 
36 
     | 
    
         
             
            	opt :only, "Only compiled direct dependencies."
         
     | 
| 
       37 
37 
     | 
    
         
             
            	opt :in, "Work in the given directory.", :type => :string
         
     | 
| 
      
 38 
     | 
    
         
            +
            	opt :unlock, "Don't use package lockfile when fetching."
         
     | 
| 
       38 
39 
     | 
    
         | 
| 
       39 
40 
     | 
    
         
             
            	opt :configuration, "Specify a specific build configuration.", :type => :string
         
     | 
| 
       40 
41 
     | 
    
         
             
            end
         
     | 
| 
         @@ -94,24 +95,45 @@ module Application 
     | 
|
| 
       94 
95 
     | 
    
         
             
            	end
         
     | 
| 
       95 
96 
     | 
    
         
             
            end
         
     | 
| 
       96 
97 
     | 
    
         | 
| 
      
 98 
     | 
    
         
            +
            def track_time
         
     | 
| 
      
 99 
     | 
    
         
            +
            	start_time = Time.now
         
     | 
| 
      
 100 
     | 
    
         
            +
            	
         
     | 
| 
      
 101 
     | 
    
         
            +
            	yield
         
     | 
| 
      
 102 
     | 
    
         
            +
            	
         
     | 
| 
      
 103 
     | 
    
         
            +
            ensure
         
     | 
| 
      
 104 
     | 
    
         
            +
            	end_time = Time.now
         
     | 
| 
      
 105 
     | 
    
         
            +
            	elapsed_time = end_time - start_time
         
     | 
| 
      
 106 
     | 
    
         
            +
            	
         
     | 
| 
      
 107 
     | 
    
         
            +
            	$stdout.flush
         
     | 
| 
      
 108 
     | 
    
         
            +
            	$stderr.puts ("Elapsed Time: %0.3fs" % elapsed_time).color(:magenta)
         
     | 
| 
      
 109 
     | 
    
         
            +
            end
         
     | 
| 
      
 110 
     | 
    
         
            +
             
     | 
| 
       97 
111 
     | 
    
         
             
            valid_actions = (Application.public_methods - Module.methods).collect(&:to_s)
         
     | 
| 
       98 
112 
     | 
    
         
             
            action = ARGV.shift
         
     | 
| 
       99 
113 
     | 
    
         | 
| 
       100 
114 
     | 
    
         
             
            # Check that the command was invoked correctly...
         
     | 
| 
       101 
115 
     | 
    
         
             
            unless action and valid_actions.include?(action)
         
     | 
| 
       102 
116 
     | 
    
         
             
            	puts "You must specify an action from: #{valid_actions.join(', ')}".color(:red)
         
     | 
| 
      
 117 
     | 
    
         
            +
            	
         
     | 
| 
       103 
118 
     | 
    
         
             
            	exit -1
         
     | 
| 
       104 
119 
     | 
    
         
             
            end
         
     | 
| 
       105 
120 
     | 
    
         | 
| 
       106 
     | 
    
         
            -
             
     | 
| 
      
 121 
     | 
    
         
            +
            track_time do
         
     | 
| 
       107 
122 
     | 
    
         
             
            	begin
         
     | 
| 
       108 
123 
     | 
    
         
             
            		Application.send(action.to_sym)
         
     | 
| 
       109 
124 
     | 
    
         
             
            	rescue Teapot::NonexistantTeapotError => error
         
     | 
| 
       110 
125 
     | 
    
         
             
            		$stderr.puts error.message.color(:red)
         
     | 
| 
      
 126 
     | 
    
         
            +
            		
         
     | 
| 
      
 127 
     | 
    
         
            +
            		exit -2
         
     | 
| 
       111 
128 
     | 
    
         
             
            	rescue Teapot::IncompatibleTeapotError => error
         
     | 
| 
       112 
129 
     | 
    
         
             
            		$stderr.puts error.message.color(:red)
         
     | 
| 
      
 130 
     | 
    
         
            +
            		$stderr.puts "Supported minimum version #{Teapot::MINIMUM_LOADER_VERSION.dump} to #{Teapot::LOADER_VERSION.dump}."
         
     | 
| 
      
 131 
     | 
    
         
            +
            		
         
     | 
| 
      
 132 
     | 
    
         
            +
            		exit -3
         
     | 
| 
       113 
133 
     | 
    
         
             
            	rescue Teapot::Commands::CommandError => error
         
     | 
| 
       114 
134 
     | 
    
         
             
            		$stderr.puts error.message.color(:red)
         
     | 
| 
      
 135 
     | 
    
         
            +
            		
         
     | 
| 
      
 136 
     | 
    
         
            +
            		exit -4
         
     | 
| 
       115 
137 
     | 
    
         
             
            	rescue Teapot::Dependency::UnresolvedDependencyError => error
         
     | 
| 
       116 
138 
     | 
    
         
             
            		$stderr.puts "Unresolved dependencies:"
         
     | 
| 
       117 
139 
     | 
    
         | 
| 
         @@ -128,8 +150,7 @@ time = Benchmark.measure do 
     | 
|
| 
       128 
150 
     | 
    
         
             
            		end
         
     | 
| 
       129 
151 
     | 
    
         | 
| 
       130 
152 
     | 
    
         
             
            		$stderr.puts "Cannot continue due to unresolved dependencies!".color(:red)
         
     | 
| 
      
 153 
     | 
    
         
            +
            		
         
     | 
| 
      
 154 
     | 
    
         
            +
            		exit -5
         
     | 
| 
       131 
155 
     | 
    
         
             
            	end
         
     | 
| 
       132 
156 
     | 
    
         
             
            end
         
     | 
| 
       133 
     | 
    
         
            -
             
     | 
| 
       134 
     | 
    
         
            -
            $stdout.flush
         
     | 
| 
       135 
     | 
    
         
            -
            $stderr.puts time.format("Elapsed Time: %r").color(:magenta)
         
     | 
    
        data/lib/teapot/context.rb
    CHANGED
    
    | 
         @@ -154,7 +154,8 @@ module Teapot 
     | 
|
| 
       154 
154 
     | 
    
         
             
            			packages.collect do |package|
         
     | 
| 
       155 
155 
     | 
    
         
             
            				begin
         
     | 
| 
       156 
156 
     | 
    
         
             
            					definitions = load(package)
         
     | 
| 
       157 
     | 
    
         
            -
            				rescue NonexistantTeapotError
         
     | 
| 
      
 157 
     | 
    
         
            +
            				rescue NonexistantTeapotError, IncompatibleTeapotError
         
     | 
| 
      
 158 
     | 
    
         
            +
            					# If the package doesn't exist or the teapot version is too old, it failed:
         
     | 
| 
       158 
159 
     | 
    
         
             
            					failed_to_load << package
         
     | 
| 
       159 
160 
     | 
    
         
             
            				end
         
     | 
| 
       160 
161 
     | 
    
         
             
            			end
         
     | 
| 
         @@ -86,7 +86,11 @@ module Teapot 
     | 
|
| 
       86 
86 
     | 
    
         
             
            					destination_path.make_symlink(local_path)
         
     | 
| 
       87 
87 
     | 
    
         
             
            				end
         
     | 
| 
       88 
88 
     | 
    
         
             
            			elsif package.external?
         
     | 
| 
       89 
     | 
    
         
            -
            				package_lock =  
     | 
| 
      
 89 
     | 
    
         
            +
            				package_lock = nil
         
     | 
| 
      
 90 
     | 
    
         
            +
            				
         
     | 
| 
      
 91 
     | 
    
         
            +
            				unless @options[:unlock]
         
     | 
| 
      
 92 
     | 
    
         
            +
            					package_lock = lock_store.transaction(true){|store| store[package.name]}
         
     | 
| 
      
 93 
     | 
    
         
            +
            				end
         
     | 
| 
       90 
94 
     | 
    
         | 
| 
       91 
95 
     | 
    
         
             
            				log "Fetching #{package}...".color(:cyan)
         
     | 
| 
       92 
96 
     | 
    
         | 
    
        data/lib/teapot/loader.rb
    CHANGED
    
    | 
         @@ -30,8 +30,8 @@ module Teapot 
     | 
|
| 
       30 
30 
     | 
    
         
             
            	MINIMUM_LOADER_VERSION = "0.8"
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
       32 
32 
     | 
    
         
             
            	class IncompatibleTeapotError < StandardError
         
     | 
| 
       33 
     | 
    
         
            -
            		def initialize(version)
         
     | 
| 
       34 
     | 
    
         
            -
            			super " 
     | 
| 
      
 33 
     | 
    
         
            +
            		def initialize(package, version)
         
     | 
| 
      
 34 
     | 
    
         
            +
            			super "Unsupported teapot_version #{version} in #{package.path}!"
         
     | 
| 
       35 
35 
     | 
    
         
             
            		end
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
       37 
37 
     | 
    
         
             
            		attr :version
         
     | 
| 
         @@ -39,7 +39,7 @@ module Teapot 
     | 
|
| 
       39 
39 
     | 
    
         | 
| 
       40 
40 
     | 
    
         
             
            	class NonexistantTeapotError < StandardError
         
     | 
| 
       41 
41 
     | 
    
         
             
            		def initialize(path)
         
     | 
| 
       42 
     | 
    
         
            -
            			super "Could not  
     | 
| 
      
 42 
     | 
    
         
            +
            			super "Could not read file at #{path}!"
         
     | 
| 
       43 
43 
     | 
    
         
             
            		end
         
     | 
| 
       44 
44 
     | 
    
         | 
| 
       45 
45 
     | 
    
         
             
            		attr :path
         
     | 
| 
         @@ -74,7 +74,7 @@ module Teapot 
     | 
|
| 
       74 
74 
     | 
    
         
             
            			if version >= MINIMUM_LOADER_VERSION && version <= LOADER_VERSION
         
     | 
| 
       75 
75 
     | 
    
         
             
            				@version = version
         
     | 
| 
       76 
76 
     | 
    
         
             
            			else
         
     | 
| 
       77 
     | 
    
         
            -
            				raise IncompatibleTeapotError.new(version)
         
     | 
| 
      
 77 
     | 
    
         
            +
            				raise IncompatibleTeapotError.new(package, version)
         
     | 
| 
       78 
78 
     | 
    
         
             
            			end
         
     | 
| 
       79 
79 
     | 
    
         
             
            		end
         
     | 
| 
       80 
80 
     | 
    
         | 
| 
         @@ -128,7 +128,7 @@ module Teapot 
     | 
|
| 
       128 
128 
     | 
    
         
             
            			self.instance_eval(absolute_path.read, absolute_path.to_s)
         
     | 
| 
       129 
129 
     | 
    
         | 
| 
       130 
130 
     | 
    
         
             
            			if @version == nil
         
     | 
| 
       131 
     | 
    
         
            -
            				raise IncompatibleTeapotError.new("<unspecified>")
         
     | 
| 
      
 131 
     | 
    
         
            +
            				raise IncompatibleTeapotError.new(@package, "<unspecified>")
         
     | 
| 
       132 
132 
     | 
    
         
             
            			end
         
     | 
| 
       133 
133 
     | 
    
         
             
            		end
         
     | 
| 
       134 
134 
     | 
    
         
             
            	end
         
     | 
    
        data/lib/teapot/version.rb
    CHANGED
    
    
    
        data/test/teapot.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: teapot
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.8. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.8.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Samuel Williams
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2013-05- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2013-05-13 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rainbow
         
     |