Sha256: 6cf249d97af42c7a843d7742db4277aa87a2cea63eefc5806d6c55a392928fa8

Contents?: true

Size: 1.97 KB

Versions: 7

Compression:

Stored size: 1.97 KB

Contents

class Jeweler
  class Generator
    class Application
      class << self
        def run!(*arguments)
          options = Jeweler::Generator::Options.new(arguments)

          if options[:show_help]
            $stderr.puts options.opts
            return 1
          end

          unless arguments.size == 1
            $stderr.puts options.opts
            return 1
          end

          github_repo_name = arguments.first

          begin
            generator = Jeweler::Generator.new(github_repo_name, options)
            generator.run
            return 0
          rescue Jeweler::NoGitUserName
            $stderr.puts %Q{No user.name found in ~/.gitconfig. Please tell git about yourself (see http://github.com/guides/tell-git-your-user-name-and-email-address for details). For example: git config --global user.name "mad voo"}
            return 1
          rescue Jeweler::NoGitUserEmail
            $stderr.puts %Q{No user.email found in ~/.gitconfig. Please tell git about yourself (see http://github.com/guides/tell-git-your-user-name-and-email-address for details). For example: git config --global user.email mad.vooo@gmail.com}
            return 1
          rescue Jeweler::NoGitHubUser
            $stderr.puts %Q{No github.user found in ~/.gitconfig. Please tell git about your GitHub account (see http://github.com/blog/180-local-github-config for details). For example: git config --global github.user defunkt}
            return 1
          rescue Jeweler::NoGitHubToken
            $stderr.puts %Q{No github.token found in ~/.gitconfig. Please tell git about your GitHub account (see http://github.com/blog/180-local-github-config for details). For example: git config --global github.token 6ef8395fecf207165f1a82178ae1b984}
            return 1
          rescue Jeweler::FileInTheWay
            $stderr.puts "The directory #{github_repo_name} already exists. Maybe move it out of the way before continuing?"
            return 1
          end
        end
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
dima-jeweler-0.9.2 lib/jeweler/generator/application.rb
technicalpickles-jeweler-0.10.0 lib/jeweler/generator/application.rb
technicalpickles-jeweler-0.10.1 lib/jeweler/generator/application.rb
technicalpickles-jeweler-0.10.2 lib/jeweler/generator/application.rb
technicalpickles-jeweler-0.9.0 lib/jeweler/generator/application.rb
technicalpickles-jeweler-0.9.1 lib/jeweler/generator/application.rb
jeweler-0.10.2 lib/jeweler/generator/application.rb