morning_glory 0.0.1 → 0.0.2
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/.gitignore +2 -0
 - data/.rvmrc +2 -0
 - data/Gemfile +4 -0
 - data/README.textile +4 -0
 - data/Rakefile +3 -0
 - data/lib/morning_glory.rb +9 -4
 - data/lib/morning_glory/version.rb +3 -0
 - data/lib/tasks/morning_glory.rake +7 -3
 - data/morning_glory.gemspec +12 -3
 - metadata +42 -31
 
    
        data/.gitignore
    ADDED
    
    
    
        data/.rvmrc
    ADDED
    
    
    
        data/Gemfile
    ADDED
    
    
    
        data/README.textile
    CHANGED
    
    | 
         @@ -1,3 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            http://www.engineyard.com/blog/2010/extending-rails-3-with-railties/
         
     | 
| 
      
 2 
     | 
    
         
            +
            http://www.igvita.com/2010/08/04/rails-3-internals-railtie-creating-plugins/
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
       1 
5 
     | 
    
         
             
            h1. Morning Glory
         
     | 
| 
       2 
6 
     | 
    
         | 
| 
       3 
7 
     | 
    
         
             
            Morning Glory is comprised of a rake task and helper methods that manages the deployment of static assets into an Amazon CloudFront CDN's S3 Bucket, improving the performance of static assets on your Rails web applications.
         
     | 
    
        data/Rakefile
    CHANGED
    
    
    
        data/lib/morning_glory.rb
    CHANGED
    
    | 
         @@ -1,3 +1,5 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require "yaml"
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            # Prefix files with a revision to bust the cloudfront non-expiring cache. For instance, /REV_1234/myfile.png
         
     | 
| 
       2 
4 
     | 
    
         
             
            CLOUDFRONT_REVISION_PREFIX = 'REV_'
         
     | 
| 
       3 
5 
     | 
    
         | 
| 
         @@ -5,15 +7,18 @@ module MorningGlory 
     | 
|
| 
       5 
7 
     | 
    
         
             
              # Nothing
         
     | 
| 
       6 
8 
     | 
    
         
             
            end
         
     | 
| 
       7 
9 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
            begin
         
     | 
| 
       9 
     | 
    
         
            -
               
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
      
 10 
     | 
    
         
            +
            begin         
         
     | 
| 
      
 11 
     | 
    
         
            +
            #  puts "hello"
         
     | 
| 
      
 12 
     | 
    
         
            +
             # directory = FILE.dirname(__FILE__)
         
     | 
| 
      
 13 
     | 
    
         
            +
             # puts "directory = #{directory} "
         
     | 
| 
      
 14 
     | 
    
         
            +
              MORNING_GLORY_CONFIG = YAML.load_file("#{Rails.root}/config/morning_glory.yml") if !defined? MORNING_GLORY_CONFIG
         
     | 
| 
      
 15 
     | 
    
         
            +
            #rescue
         
     | 
| 
       11 
16 
     | 
    
         
             
              raise "Error loading MorningGlory configuration files. Please check config/morning_glory.yml is configured correctly."
         
     | 
| 
       12 
17 
     | 
    
         
             
            end
         
     | 
| 
       13 
18 
     | 
    
         | 
| 
       14 
19 
     | 
    
         
             
            begin
         
     | 
| 
       15 
20 
     | 
    
         
             
              if (!ENV['S3_KEY'] && !ENV['S3_SECRET'])   
         
     | 
| 
       16 
     | 
    
         
            -
                S3_CONFIG = YAML.load_file("#{ 
     | 
| 
      
 21 
     | 
    
         
            +
                S3_CONFIG = YAML.load_file("#{Rails.root}/config/s3.yml")[Rails.env] if !defined? S3_CONFIG
         
     | 
| 
       17 
22 
     | 
    
         
             
              end
         
     | 
| 
       18 
23 
     | 
    
         | 
| 
       19 
24 
     | 
    
         
             
            rescue
         
     | 
| 
         @@ -6,8 +6,12 @@ namespace :morning_glory do 
     | 
|
| 
       6 
6 
     | 
    
         
             
                @@prev_cdn_revision = nil
         
     | 
| 
       7 
7 
     | 
    
         
             
                @@scm_commit_required = false
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
                begin
         
     | 
| 
       10 
     | 
    
         
            -
                   
     | 
| 
      
 9 
     | 
    
         
            +
                begin                                
         
     | 
| 
      
 10 
     | 
    
         
            +
            #      puts "path = #{path}"  
         
     | 
| 
      
 11 
     | 
    
         
            +
            #      directory = FILE.dirname(__FILE__)
         
     | 
| 
      
 12 
     | 
    
         
            +
            #      puts "directory = #{directory} "
         
     | 
| 
      
 13 
     | 
    
         
            +
                  MORNING_GLORY_CONFIG = YAML.load_file("#{Rails.root}/config/morning_glory.yml") if !defined? MORNING_GLORY_CONFIG
         
     | 
| 
      
 14 
     | 
    
         
            +
            #      puts "morning glory loaded"
         
     | 
| 
       11 
15 
     | 
    
         
             
                rescue
         
     | 
| 
       12 
16 
     | 
    
         
             
                end
         
     | 
| 
       13 
17 
     | 
    
         | 
| 
         @@ -67,7 +71,7 @@ namespace :morning_glory do 
     | 
|
| 
       67 
71 
     | 
    
         
             
                  # Store the previous revision so we can delete the bucket from S3 later after deploy
         
     | 
| 
       68 
72 
     | 
    
         
             
                  @@prev_cdn_revision = CLOUDFRONT_REVISION_PREFIX + prev
         
     | 
| 
       69 
73 
     | 
    
         | 
| 
       70 
     | 
    
         
            -
                  File.open("#{ 
     | 
| 
      
 74 
     | 
    
         
            +
                  File.open("#{path}/config/morning_glory.yml", 'w') { |f| YAML.dump(MORNING_GLORY_CONFIG, f) }
         
     | 
| 
       71 
75 
     | 
    
         | 
| 
       72 
76 
     | 
    
         
             
                  puts "* CDN revision updated for '#{Rails.env}' environment to #{ENV['RAILS_ASSET_ID']}" 
         
     | 
| 
       73 
77 
     | 
    
         
             
                end
         
     | 
    
        data/morning_glory.gemspec
    CHANGED
    
    | 
         @@ -1,6 +1,10 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # -*- encoding: utf-8 -*-
         
     | 
| 
      
 2 
     | 
    
         
            +
            $:.push File.expand_path("../lib", __FILE__)
         
     | 
| 
      
 3 
     | 
    
         
            +
            require "morning_glory/version"
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
       1 
5 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       2 
6 
     | 
    
         
             
              s.name        = 'morning_glory'
         
     | 
| 
       3 
     | 
    
         
            -
              s.version     =  
     | 
| 
      
 7 
     | 
    
         
            +
              s.version     = MorningGlory::VERSION
         
     | 
| 
       4 
8 
     | 
    
         
             
              s.date        = '2011-07-21'
         
     | 
| 
       5 
9 
     | 
    
         
             
              s.summary     = "Morning Glory is comprised of a rake task and helper methods that manages the deployment of static assets into an Amazon CloudFront CDN’s S3 Bucket, improving the performance of static assets on your Rails web applications."
         
     | 
| 
       6 
10 
     | 
    
         
             
              s.description = File.read(File.join(File.dirname(__FILE__), 'README.textile'))
         
     | 
| 
         @@ -8,11 +12,16 @@ Gem::Specification.new do |s| 
     | 
|
| 
       8 
12 
     | 
    
         
             
              s.required_ruby_version = '>=1.9'
         
     | 
| 
       9 
13 
     | 
    
         
             
              s.authors     = ["Adam Burmister", "Todd Sedano"]
         
     | 
| 
       10 
14 
     | 
    
         
             
              s.email       = 'professor@gmail.com'
         
     | 
| 
       11 
     | 
    
         
            -
              s.files	      = Dir['**/**']  
         
     | 
| 
       12 
15 
     | 
    
         
             
              s.homepage    = 'https://github.com/professor/morning_glory'
         
     | 
| 
       13 
     | 
    
         
            -
              s.license = 'MIT'
         
     | 
| 
      
 16 
     | 
    
         
            +
              s.license = 'MIT'                    
         
     | 
| 
      
 17 
     | 
    
         
            +
              s.files         = `git ls-files`.split("\n")
         
     | 
| 
      
 18 
     | 
    
         
            +
              s.test_files    = `git ls-files -- {test,spec,features}/*`.split("\n")
         
     | 
| 
      
 19 
     | 
    
         
            +
              s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
         
     | 
| 
      
 20 
     | 
    
         
            +
              s.require_paths = ["lib"]  
         
     | 
| 
       14 
21 
     | 
    
         
             
              s.add_development_dependency 'aws-s3'
         
     | 
| 
      
 22 
     | 
    
         
            +
              s.add_development_dependency 'rails'
         
     | 
| 
       15 
23 
     | 
    
         
             
              s.add_runtime_dependency 'aws-s3'
         
     | 
| 
      
 24 
     | 
    
         
            +
              s.add_runtime_dependency 'rails'
         
     | 
| 
       16 
25 
     | 
    
         
             
            #  s.has_rdoc	  = false  
         
     | 
| 
       17 
26 
     | 
    
         
             
            # s.test_files = Dir["test/test*.rb"]
         
     | 
| 
       18 
27 
     | 
    
         
             
            # s.executables = [ 'anagram' ]
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,13 +1,8 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: morning_glory
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
               
     | 
| 
       5 
     | 
    
         
            -
               
     | 
| 
       6 
     | 
    
         
            -
              segments: 
         
     | 
| 
       7 
     | 
    
         
            -
              - 0
         
     | 
| 
       8 
     | 
    
         
            -
              - 0
         
     | 
| 
       9 
     | 
    
         
            -
              - 1
         
     | 
| 
       10 
     | 
    
         
            -
              version: 0.0.1
         
     | 
| 
      
 4 
     | 
    
         
            +
              prerelease: 
         
     | 
| 
      
 5 
     | 
    
         
            +
              version: 0.0.2
         
     | 
| 
       11 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       12 
7 
     | 
    
         
             
            authors: 
         
     | 
| 
       13 
8 
     | 
    
         
             
            - Adam Burmister
         
     | 
| 
         @@ -16,8 +11,7 @@ autorequire: 
     | 
|
| 
       16 
11 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       17 
12 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       18 
13 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
            date: 2011-07-21 00:00:00  
     | 
| 
       20 
     | 
    
         
            -
            default_executable: 
         
     | 
| 
      
 14 
     | 
    
         
            +
            date: 2011-07-21 00:00:00 Z
         
     | 
| 
       21 
15 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       22 
16 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       23 
17 
     | 
    
         
             
              name: aws-s3
         
     | 
| 
         @@ -27,27 +21,47 @@ dependencies: 
     | 
|
| 
       27 
21 
     | 
    
         
             
                requirements: 
         
     | 
| 
       28 
22 
     | 
    
         
             
                - - ">="
         
     | 
| 
       29 
23 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       30 
     | 
    
         
            -
                    hash: 3
         
     | 
| 
       31 
     | 
    
         
            -
                    segments: 
         
     | 
| 
       32 
     | 
    
         
            -
                    - 0
         
     | 
| 
       33 
24 
     | 
    
         
             
                    version: "0"
         
     | 
| 
       34 
25 
     | 
    
         
             
              type: :development
         
     | 
| 
       35 
26 
     | 
    
         
             
              version_requirements: *id001
         
     | 
| 
       36 
27 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       37 
     | 
    
         
            -
              name:  
     | 
| 
      
 28 
     | 
    
         
            +
              name: rails
         
     | 
| 
       38 
29 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       39 
30 
     | 
    
         
             
              requirement: &id002 !ruby/object:Gem::Requirement 
         
     | 
| 
       40 
31 
     | 
    
         
             
                none: false
         
     | 
| 
       41 
32 
     | 
    
         
             
                requirements: 
         
     | 
| 
       42 
33 
     | 
    
         
             
                - - ">="
         
     | 
| 
       43 
34 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
       44 
     | 
    
         
            -
                    hash: 3
         
     | 
| 
       45 
     | 
    
         
            -
                    segments: 
         
     | 
| 
       46 
     | 
    
         
            -
                    - 0
         
     | 
| 
       47 
35 
     | 
    
         
             
                    version: "0"
         
     | 
| 
       48 
     | 
    
         
            -
              type: : 
     | 
| 
      
 36 
     | 
    
         
            +
              type: :development
         
     | 
| 
       49 
37 
     | 
    
         
             
              version_requirements: *id002
         
     | 
| 
      
 38 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 39 
     | 
    
         
            +
              name: aws-s3
         
     | 
| 
      
 40 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 41 
     | 
    
         
            +
              requirement: &id003 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 42 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 43 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 44 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 45 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 46 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 47 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 48 
     | 
    
         
            +
              version_requirements: *id003
         
     | 
| 
      
 49 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency 
         
     | 
| 
      
 50 
     | 
    
         
            +
              name: rails
         
     | 
| 
      
 51 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 52 
     | 
    
         
            +
              requirement: &id004 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 53 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 54 
     | 
    
         
            +
                requirements: 
         
     | 
| 
      
 55 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 56 
     | 
    
         
            +
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 57 
     | 
    
         
            +
                    version: "0"
         
     | 
| 
      
 58 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 59 
     | 
    
         
            +
              version_requirements: *id004
         
     | 
| 
       50 
60 
     | 
    
         
             
            description: |-
         
     | 
| 
      
 61 
     | 
    
         
            +
              http://www.engineyard.com/blog/2010/extending-rails-3-with-railties/
         
     | 
| 
      
 62 
     | 
    
         
            +
              http://www.igvita.com/2010/08/04/rails-3-internals-railtie-creating-plugins/
         
     | 
| 
      
 63 
     | 
    
         
            +
              
         
     | 
| 
      
 64 
     | 
    
         
            +
              
         
     | 
| 
       51 
65 
     | 
    
         
             
              h1. Morning Glory
         
     | 
| 
       52 
66 
     | 
    
         | 
| 
       53 
67 
     | 
    
         
             
              Morning Glory is comprised of a rake task and helper methods that manages the deployment of static assets into an Amazon CloudFront CDN's S3 Bucket, improving the performance of static assets on your Rails web applications.
         
     | 
| 
         @@ -162,20 +176,23 @@ extensions: [] 
     | 
|
| 
       162 
176 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       163 
177 
     | 
    
         | 
| 
       164 
178 
     | 
    
         
             
            files: 
         
     | 
| 
      
 179 
     | 
    
         
            +
            - .gitignore
         
     | 
| 
      
 180 
     | 
    
         
            +
            - .rvmrc
         
     | 
| 
      
 181 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 182 
     | 
    
         
            +
            - MIT-LICENSE
         
     | 
| 
      
 183 
     | 
    
         
            +
            - README.textile
         
     | 
| 
      
 184 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
       165 
185 
     | 
    
         
             
            - init.rb
         
     | 
| 
       166 
186 
     | 
    
         
             
            - install.rb
         
     | 
| 
       167 
187 
     | 
    
         
             
            - lib/asset_tag_helper.rb
         
     | 
| 
       168 
188 
     | 
    
         
             
            - lib/morning_glory.rb
         
     | 
| 
      
 189 
     | 
    
         
            +
            - lib/morning_glory/version.rb
         
     | 
| 
       169 
190 
     | 
    
         
             
            - lib/tasks/morning_glory.rake
         
     | 
| 
       170 
     | 
    
         
            -
            - MIT-LICENSE
         
     | 
| 
       171 
191 
     | 
    
         
             
            - morning_glory.gemspec
         
     | 
| 
       172 
192 
     | 
    
         
             
            - rails/init.rb
         
     | 
| 
       173 
     | 
    
         
            -
            - Rakefile
         
     | 
| 
       174 
     | 
    
         
            -
            - README.textile
         
     | 
| 
       175 
193 
     | 
    
         
             
            - test/morning_glory_test.rb
         
     | 
| 
       176 
194 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
       177 
195 
     | 
    
         
             
            - uninstall.rb
         
     | 
| 
       178 
     | 
    
         
            -
            has_rdoc: true
         
     | 
| 
       179 
196 
     | 
    
         
             
            homepage: https://github.com/professor/morning_glory
         
     | 
| 
       180 
197 
     | 
    
         
             
            licenses: 
         
     | 
| 
       181 
198 
     | 
    
         
             
            - MIT
         
     | 
| 
         @@ -189,26 +206,20 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       189 
206 
     | 
    
         
             
              requirements: 
         
     | 
| 
       190 
207 
     | 
    
         
             
              - - ">="
         
     | 
| 
       191 
208 
     | 
    
         
             
                - !ruby/object:Gem::Version 
         
     | 
| 
       192 
     | 
    
         
            -
                  hash: 29
         
     | 
| 
       193 
     | 
    
         
            -
                  segments: 
         
     | 
| 
       194 
     | 
    
         
            -
                  - 1
         
     | 
| 
       195 
     | 
    
         
            -
                  - 9
         
     | 
| 
       196 
209 
     | 
    
         
             
                  version: "1.9"
         
     | 
| 
       197 
210 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement 
         
     | 
| 
       198 
211 
     | 
    
         
             
              none: false
         
     | 
| 
       199 
212 
     | 
    
         
             
              requirements: 
         
     | 
| 
       200 
213 
     | 
    
         
             
              - - ">="
         
     | 
| 
       201 
214 
     | 
    
         
             
                - !ruby/object:Gem::Version 
         
     | 
| 
       202 
     | 
    
         
            -
                  hash: 3
         
     | 
| 
       203 
     | 
    
         
            -
                  segments: 
         
     | 
| 
       204 
     | 
    
         
            -
                  - 0
         
     | 
| 
       205 
215 
     | 
    
         
             
                  version: "0"
         
     | 
| 
       206 
216 
     | 
    
         
             
            requirements: []
         
     | 
| 
       207 
217 
     | 
    
         | 
| 
       208 
218 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       209 
     | 
    
         
            -
            rubygems_version: 1. 
     | 
| 
      
 219 
     | 
    
         
            +
            rubygems_version: 1.7.2
         
     | 
| 
       210 
220 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       211 
221 
     | 
    
         
             
            specification_version: 3
         
     | 
| 
       212 
222 
     | 
    
         
             
            summary: "Morning Glory is comprised of a rake task and helper methods that manages the deployment of static assets into an Amazon CloudFront CDN\xE2\x80\x99s S3 Bucket, improving the performance of static assets on your Rails web applications."
         
     | 
| 
       213 
     | 
    
         
            -
            test_files:  
     | 
| 
       214 
     | 
    
         
            -
             
     | 
| 
      
 223 
     | 
    
         
            +
            test_files: 
         
     | 
| 
      
 224 
     | 
    
         
            +
            - test/morning_glory_test.rb
         
     | 
| 
      
 225 
     | 
    
         
            +
            - test/test_helper.rb
         
     |