everyleaf-embulk_helper 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.
- checksums.yaml +4 -4
 - data/CHANGELOG.md +5 -0
 - data/Gemfile.lock +1 -1
 - data/lib/everyleaf/embulk_helper/tasks/generator/changelog.rb +3 -2
 - data/lib/everyleaf/embulk_helper/tasks/generator/gemfiles.rb +1 -1
 - data/lib/everyleaf/embulk_helper/version.rb +1 -1
 - data/test/everyleaf/embulk_helper/tasks/generator/test_gemfiles.rb +43 -0
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 36c1b41d191cb714c8d3b420d287402632ebb34c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 122aa4c29658a038ae0b9d71288c41cf660ce42a
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 90060c26bf3d014428599c451bd29c1810653d85d589979335e818d6c95316267e9a278c18a5db907a5b8e4123e33b43bef82d5173adaf7c8522317ffbb6ebf2
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 7362b8bc99f5046a4d8e77cf8c840d07c200c402ea236e008658bbfec3abf492c79903021ce36cdae703263404cfc784edb282017b61162338a76c2a3f07f063
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,3 +1,8 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ## 0.0.2 - 2015-08-11
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            * [fix] Fix gemspec path within generated gemfile template [#2](https://github.com/everyleaf/everyleaf-embulk_helper/pull/2)
         
     | 
| 
      
 4 
     | 
    
         
            +
            * [improve] generage:changelog can accept `CURRENT_VER` and `NEXT_VER` environment variable instead of auto detection
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
       1 
6 
     | 
    
         
             
            ## 0.0.1 - 2015-08-11
         
     | 
| 
       2 
7 
     | 
    
         | 
| 
       3 
8 
     | 
    
         
             
            The first release!!
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
| 
         @@ -50,10 +50,11 @@ module Everyleaf 
     | 
|
| 
       50 
50 
     | 
    
         
             
                      end
         
     | 
| 
       51 
51 
     | 
    
         | 
| 
       52 
52 
     | 
    
         
             
                      def current_version
         
     | 
| 
       53 
     | 
    
         
            -
                        Gem::Version.new(gemspec_path.read[/spec\.version += *"([0-9]+\.[0-9]+\.[0-9]+)"/, 1])
         
     | 
| 
      
 53 
     | 
    
         
            +
                        ENV["CURRENT_VER"] || Gem::Version.new(gemspec_path.read[/spec\.version += *"([0-9]+\.[0-9]+\.[0-9]+)"/, 1])
         
     | 
| 
       54 
54 
     | 
    
         
             
                      end
         
     | 
| 
       55 
55 
     | 
    
         | 
| 
       56 
56 
     | 
    
         
             
                      def next_version
         
     | 
| 
      
 57 
     | 
    
         
            +
                        return ENV["NEXT_VER"] if ENV["NEXT_VER"]
         
     | 
| 
       57 
58 
     | 
    
         
             
                        major, minor, patch = current_version.segments
         
     | 
| 
       58 
59 
     | 
    
         
             
                        ver = case version_target
         
     | 
| 
       59 
60 
     | 
    
         
             
                        when "patch"
         
     | 
| 
         @@ -81,7 +82,7 @@ module Everyleaf 
     | 
|
| 
       81 
82 
     | 
    
         | 
| 
       82 
83 
     | 
    
         
             
                      def pull_request_numbers
         
     | 
| 
       83 
84 
     | 
    
         
             
                        sync_git_repo
         
     | 
| 
       84 
     | 
    
         
            -
                        `git log v#{ 
     | 
| 
      
 85 
     | 
    
         
            +
                        `git log v#{current_version}..origin/master --oneline`.scan(/#[0-9]+/).map do |num_with_hash|
         
     | 
| 
       85 
86 
     | 
    
         
             
                          num_with_hash[/[0-9]+/]
         
     | 
| 
       86 
87 
     | 
    
         
             
                        end
         
     | 
| 
       87 
88 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -40,7 +40,7 @@ module Everyleaf 
     | 
|
| 
       40 
40 
     | 
    
         
             
                      def initial_template
         
     | 
| 
       41 
41 
     | 
    
         
             
                        <<-ERB
         
     | 
| 
       42 
42 
     | 
    
         
             
            source 'https://rubygems.org/'
         
     | 
| 
       43 
     | 
    
         
            -
            gemspec :path => '#{ 
     | 
| 
      
 43 
     | 
    
         
            +
            gemspec :path => '#{gemspec_path.dirname.relative_path_from(gemfiles_dir)}/'
         
     | 
| 
       44 
44 
     | 
    
         | 
| 
       45 
45 
     | 
    
         
             
            gem "embulk", "<%= version %>"
         
     | 
| 
       46 
46 
     | 
    
         
             
                        ERB
         
     | 
| 
         @@ -66,6 +66,49 @@ gem "embulk", "0.1.2" 
     | 
|
| 
       66 
66 
     | 
    
         
             
                        end
         
     | 
| 
       67 
67 
     | 
    
         
             
                      end
         
     | 
| 
       68 
68 
     | 
    
         | 
| 
      
 69 
     | 
    
         
            +
                      class TestInitialContent < self
         
     | 
| 
      
 70 
     | 
    
         
            +
                        def setup
         
     | 
| 
      
 71 
     | 
    
         
            +
                          FileUtils.mkdir_p root
         
     | 
| 
      
 72 
     | 
    
         
            +
                          FileUtils.touch gemspec_path
         
     | 
| 
      
 73 
     | 
    
         
            +
             
     | 
| 
      
 74 
     | 
    
         
            +
                          task = Gemfiles.new(options.merge({
         
     | 
| 
      
 75 
     | 
    
         
            +
                            github_name: "dummy/dummy",
         
     | 
| 
      
 76 
     | 
    
         
            +
                            gemspec: gemspec_path,
         
     | 
| 
      
 77 
     | 
    
         
            +
                            gemfile_template_path: gemfile_template_path,
         
     | 
| 
      
 78 
     | 
    
         
            +
                          }))
         
     | 
| 
      
 79 
     | 
    
         
            +
                          mute_logger(task)
         
     | 
| 
      
 80 
     | 
    
         
            +
                          task.send(:init)
         
     | 
| 
      
 81 
     | 
    
         
            +
                        end
         
     | 
| 
      
 82 
     | 
    
         
            +
             
     | 
| 
      
 83 
     | 
    
         
            +
                        def teardown
         
     | 
| 
      
 84 
     | 
    
         
            +
                          FileUtils.rm_rf root
         
     | 
| 
      
 85 
     | 
    
         
            +
                        end
         
     | 
| 
      
 86 
     | 
    
         
            +
             
     | 
| 
      
 87 
     | 
    
         
            +
                        def test_relative_path
         
     | 
| 
      
 88 
     | 
    
         
            +
                          content = File.read(gemfile_template_path)
         
     | 
| 
      
 89 
     | 
    
         
            +
                          assert content.include?("path => '../'") # the gemspec path from each gemfiles/* as relative
         
     | 
| 
      
 90 
     | 
    
         
            +
                        end
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
      
 92 
     | 
    
         
            +
                        def test_embulk_version_contain
         
     | 
| 
      
 93 
     | 
    
         
            +
                          content = File.read(gemfile_template_path)
         
     | 
| 
      
 94 
     | 
    
         
            +
                          assert content.include?(%Q|gem "embulk", "<%= version %>"|)
         
     | 
| 
      
 95 
     | 
    
         
            +
                        end
         
     | 
| 
      
 96 
     | 
    
         
            +
             
     | 
| 
      
 97 
     | 
    
         
            +
                        private
         
     | 
| 
      
 98 
     | 
    
         
            +
             
     | 
| 
      
 99 
     | 
    
         
            +
                        def gemfile_template_path
         
     | 
| 
      
 100 
     | 
    
         
            +
                          root.join("gemfiles/template.erb")
         
     | 
| 
      
 101 
     | 
    
         
            +
                        end
         
     | 
| 
      
 102 
     | 
    
         
            +
             
     | 
| 
      
 103 
     | 
    
         
            +
                        def root
         
     | 
| 
      
 104 
     | 
    
         
            +
                          Pathname.new("/tmp/foo")
         
     | 
| 
      
 105 
     | 
    
         
            +
                        end
         
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
                        def gemspec_path
         
     | 
| 
      
 108 
     | 
    
         
            +
                          root.join("bar.spec")
         
     | 
| 
      
 109 
     | 
    
         
            +
                        end
         
     | 
| 
      
 110 
     | 
    
         
            +
                      end
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
       69 
112 
     | 
    
         
             
                      def test_task_installed
         
     | 
| 
       70 
113 
     | 
    
         
             
                        Everyleaf::EmbulkHelper::Tasks.install(options)
         
     | 
| 
       71 
114 
     | 
    
         
             
                        gemfiles_task = Rake::Task.tasks.find do |task|
         
     |