ruby-station 0.1.3 → 0.1.4.rc1
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/History.txt +21 -0
- data/Rakefile +8 -5
- data/bin/ruby-station +14 -11
- data/config.rb +10 -5
- data/controller/applications.rb +18 -25
- data/model/application.rb +35 -1
- data/model/init.rb +1 -1
- data/ruby-station.gemspec +39 -25
- data/runtime/VERSION +1 -1
- data/runtime/lib/ruby-station.rb +0 -2
- data/runtime/ruby-station-runtime-0.0.5.gem +0 -0
- data/runtime/ruby-station-runtime.gemspec +26 -0
- data/sample.config.yaml +3 -1
- data/tests/README +10 -7
- data/tests/Rakefile +11 -0
- data/tests/console.rb +11 -0
- data/tests/data/conf_dir/config.yaml +4 -2
- data/tests/data/hello/hello-ruby-station.gemspec +34 -0
- data/tests/data/hello/main.rb +15 -0
- data/tests/data/hello/pkg/hello-ruby-station-0.3.1.gem +0 -0
- data/tests/data/hello/pkg/hello-ruby-station-0.3.2.gem +0 -0
- data/tests/development/config.yaml +9 -0
- data/tests/features/install_file.feature +3 -3
- data/tests/features/list.feature +5 -6
- data/tests/features/reinstall.feature +10 -0
- data/tests/features/step_definitions/application_steps.rb +56 -9
- data/tests/features/step_definitions/{curelity_steps.rb → culerity_steps.rb} +8 -2
- data/tests/features/support/env.rb +1 -1
- data/tests/features/uninstall.feature +6 -7
- data/tests/features/upgrade.feature +8 -6
- data/tests/spec/application.rb +51 -0
- data/tests/spec/gem_manager.rb +22 -10
- data/tests/spec/servant.rb +33 -0
- data/tests/test_helper.rb +7 -11
- data/util/gem_manager.rb +63 -24
- data/view/applications/uninstall.xhtml +1 -1
- data/view/index.xhtml +1 -1
- metadata +54 -16
- data/ChangeLog +0 -3
- data/runtime/lib/ruby-station/helper/rails.rb +0 -64
- data/runtime/lib/ruby-station/helper.rb +0 -5
- data/runtime/ruby-station-runtime-0.0.4.gem +0 -0
    
        data/History.txt
    ADDED
    
    | @@ -0,0 +1,21 @@ | |
| 1 | 
            +
            2009-10-02 version x x x
         | 
| 2 | 
            +
             | 
| 3 | 
            +
              * new: option --version
         | 
| 4 | 
            +
              * fix: catch gem errors
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            2009-10-02 version 0.1.3
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            	* new: added tests
         | 
| 9 | 
            +
              * new: support ruby 1.8 on unixes
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            2009-08-15 version 0.0.4
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              * new: added runtime library for applications
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            2009-08-13 version 0.0.3
         | 
| 16 | 
            +
             | 
| 17 | 
            +
              * fix: save ruby-station.db in @home
         | 
| 18 | 
            +
             | 
| 19 | 
            +
            2009-07-19 version 0.0.2
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              * initial version
         | 
    
        data/Rakefile
    CHANGED
    
    | @@ -13,11 +13,14 @@ Jeweler::Tasks.new do |gemspec| | |
| 13 13 | 
             
              gemspec.homepage = "http://github.com/yhara/#{PROJECT_NAME}"
         | 
| 14 14 | 
             
              gemspec.description = gemspec.summary
         | 
| 15 15 | 
             
              gemspec.authors = ["Yutaka HARA"]
         | 
| 16 | 
            -
              gemspec.add_dependency('ramaze', ' | 
| 17 | 
            -
              gemspec.add_dependency('dm-core', ' | 
| 18 | 
            -
              gemspec.add_dependency('do_sqlite3', ' | 
| 19 | 
            -
              gemspec.add_development_dependency('rspec', ' | 
| 20 | 
            -
              gemspec.add_development_dependency('cucumber', ' | 
| 16 | 
            +
              gemspec.add_dependency('ramaze', '= 2009.07')
         | 
| 17 | 
            +
              gemspec.add_dependency('dm-core', '= 0.10.1')
         | 
| 18 | 
            +
              gemspec.add_dependency('do_sqlite3', '= 0.10.0')
         | 
| 19 | 
            +
              gemspec.add_development_dependency('rspec', '= 1.2.9')
         | 
| 20 | 
            +
              gemspec.add_development_dependency('cucumber', '= 0.4.2')
         | 
| 21 | 
            +
              gemspec.add_development_dependency('rack-test', '= 0.5.0')
         | 
| 22 | 
            +
              gemspec.add_development_dependency('webrat', '= 0.5.3')
         | 
| 23 | 
            +
              gemspec.add_development_dependency('culerity', '= 0.2.3')
         | 
| 21 24 | 
             
              gemspec.executables = ["ruby-station"]
         | 
| 22 25 | 
             
            end
         | 
| 23 26 |  | 
    
        data/bin/ruby-station
    CHANGED
    
    | @@ -8,20 +8,23 @@ $LOAD_PATH.unshift __DIR__("../") | |
| 8 8 |  | 
| 9 9 | 
             
            require 'util/gem_manager.rb'
         | 
| 10 10 | 
             
            require 'config.rb'
         | 
| 11 | 
            -
            if defined?(TESTS_DIR)
         | 
| 12 | 
            -
              Conf.set_home(TESTS_DIR/"data/conf_dir/")
         | 
| 13 | 
            -
            else
         | 
| 14 | 
            -
              Conf.parse_opt
         | 
| 15 | 
            -
            end
         | 
| 16 | 
            -
            Conf.init
         | 
| 17 11 |  | 
| 18 12 | 
             
            require 'util/servant.rb'
         | 
| 19 13 | 
             
            require 'controller/init'
         | 
| 20 14 | 
             
            require 'model/init'
         | 
| 21 15 |  | 
| 22 | 
            -
             | 
| 23 | 
            -
               | 
| 16 | 
            +
            def start_ramaze
         | 
| 17 | 
            +
              if Conf.debug
         | 
| 18 | 
            +
                Ramaze::Log.info "Starting Ramaze with dev mode"
         | 
| 19 | 
            +
              end
         | 
| 20 | 
            +
              Ramaze::Log.info "Starting Ramaze with port #{Conf.server_port}"
         | 
| 21 | 
            +
              Ramaze.start :port => Conf.server_port,
         | 
| 22 | 
            +
                           :root => __DIR__("../"),
         | 
| 23 | 
            +
                           :mode => (Conf.debug ? :dev : :live)
         | 
| 24 | 
            +
            end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
            if defined?(TESTS_DIR)
         | 
| 27 | 
            +
              Thread.new{ start_ramaze }
         | 
| 28 | 
            +
            else
         | 
| 29 | 
            +
              start_ramaze
         | 
| 24 30 | 
             
            end
         | 
| 25 | 
            -
            Ramaze.start :port => Conf.server_port,
         | 
| 26 | 
            -
                         :root => __DIR__("../"),
         | 
| 27 | 
            -
                         :mode => (Conf.debug ? :dev : :live)
         | 
    
        data/config.rb
    CHANGED
    
    | @@ -10,16 +10,13 @@ module RubyStation | |
| 10 10 | 
             
            end
         | 
| 11 11 |  | 
| 12 12 | 
             
            class Conf
         | 
| 13 | 
            -
              %w(ruby_command gem_command gem_dir gem_bin_dir  | 
| 13 | 
            +
              %w(ruby_command gem_command gem_dir gem_bin_dir data_dir
         | 
| 14 | 
            +
                 db_path gem_install_option server_port debug).each do |m|
         | 
| 14 15 | 
             
                class_eval <<-EOD
         | 
| 15 16 | 
             
                  def self.#{m}; @yaml[:#{m}]; end
         | 
| 16 17 | 
             
                EOD
         | 
| 17 18 | 
             
              end
         | 
| 18 19 |  | 
| 19 | 
            -
              def self.db_path
         | 
| 20 | 
            -
                File.join(@home, "ruby-station.db")
         | 
| 21 | 
            -
              end
         | 
| 22 | 
            -
             | 
| 23 20 | 
             
              def self.parse_opt
         | 
| 24 21 | 
             
                @home = File.expand_path("~/.ruby-station")
         | 
| 25 22 |  | 
| @@ -64,6 +61,7 @@ class Conf | |
| 64 61 | 
             
                @yaml[:gem_dir] = File.expand_path(@yaml[:gem_dir], @home)
         | 
| 65 62 | 
             
                @yaml[:gem_bin_dir] = File.expand_path(@yaml[:gem_bin_dir], @home)
         | 
| 66 63 | 
             
                @yaml[:data_dir] = File.expand_path(@yaml[:data_dir], @home)
         | 
| 64 | 
            +
                @yaml[:db_path] = File.expand_path(@yaml[:db_path], @home)
         | 
| 67 65 | 
             
                FileUtils.makedirs(@yaml[:gem_dir])
         | 
| 68 66 | 
             
                FileUtils.makedirs(@yaml[:gem_bin_dir])
         | 
| 69 67 | 
             
                FileUtils.makedirs(@yaml[:data_dir])
         | 
| @@ -91,3 +89,10 @@ class Conf | |
| 91 89 |  | 
| 92 90 | 
             
              end
         | 
| 93 91 | 
             
            end
         | 
| 92 | 
            +
             | 
| 93 | 
            +
            if defined?(TESTS_DIR)
         | 
| 94 | 
            +
              Conf.set_home(TESTS_DIR/"data/conf_dir/")
         | 
| 95 | 
            +
            else
         | 
| 96 | 
            +
              Conf.parse_opt
         | 
| 97 | 
            +
            end
         | 
| 98 | 
            +
            Conf.init
         | 
    
        data/controller/applications.rb
    CHANGED
    
    | @@ -29,28 +29,22 @@ class Applications < Controller | |
| 29 29 | 
             
              end
         | 
| 30 30 |  | 
| 31 31 | 
             
              def _install
         | 
| 32 | 
            -
                 | 
| 33 | 
            -
                 | 
| 34 | 
            -
                   | 
| 35 | 
            -
                   | 
| 36 | 
            -
             | 
| 37 | 
            -
                   | 
| 38 | 
            -
             | 
| 39 | 
            -
             | 
| 40 | 
            -
             | 
| 41 | 
            -
             | 
| 42 | 
            -
             | 
| 43 | 
            -
             | 
| 44 | 
            -
             | 
| 45 | 
            -
             | 
| 46 | 
            -
             | 
| 47 | 
            -
                    :name => name,
         | 
| 48 | 
            -
                    :version => version,
         | 
| 49 | 
            -
                  })
         | 
| 32 | 
            +
                result = ""
         | 
| 33 | 
            +
                begin
         | 
| 34 | 
            +
                  case session[:source_type]
         | 
| 35 | 
            +
                  when "name"
         | 
| 36 | 
            +
                    result = Application.install(:name, session[:gemname])
         | 
| 37 | 
            +
                  when "file"
         | 
| 38 | 
            +
                    result = Application.install(:file, session[:tempfile].path)
         | 
| 39 | 
            +
                  else
         | 
| 40 | 
            +
                    raise "unknown install source type: #{session[:source_type]}"
         | 
| 41 | 
            +
                  end
         | 
| 42 | 
            +
                rescue GemManager::InstallFailed => e
         | 
| 43 | 
            +
                  result = e.message
         | 
| 44 | 
            +
                ensure
         | 
| 45 | 
            +
                  session.clear
         | 
| 46 | 
            +
                  h result
         | 
| 50 47 | 
             
                end
         | 
| 51 | 
            -
             | 
| 52 | 
            -
                session.clear
         | 
| 53 | 
            -
                h result
         | 
| 54 48 | 
             
              end
         | 
| 55 49 |  | 
| 56 50 | 
             
              def uninstall(id)
         | 
| @@ -64,12 +58,11 @@ class Applications < Controller | |
| 64 58 |  | 
| 65 59 | 
             
              def _uninstall(id)
         | 
| 66 60 | 
             
                if app = Application.get(id)
         | 
| 67 | 
            -
                  result =  | 
| 68 | 
            -
                  app.destroy
         | 
| 69 | 
            -
                  result
         | 
| 61 | 
            +
                  result = app.uninstall
         | 
| 70 62 | 
             
                else
         | 
| 71 | 
            -
                  ""
         | 
| 63 | 
            +
                  result = ""
         | 
| 72 64 | 
             
                end
         | 
| 65 | 
            +
                result
         | 
| 73 66 | 
             
              end
         | 
| 74 67 |  | 
| 75 68 | 
             
              def start(id)
         | 
    
        data/model/application.rb
    CHANGED
    
    | @@ -7,6 +7,38 @@ class Application | |
| 7 7 | 
             
              property :name, String
         | 
| 8 8 | 
             
              property :version, String
         | 
| 9 9 |  | 
| 10 | 
            +
              # Install the speficied gem and create an Application
         | 
| 11 | 
            +
              def self.install(by, value)
         | 
| 12 | 
            +
                case by
         | 
| 13 | 
            +
                when :name
         | 
| 14 | 
            +
                  result, name, version = GemManager.install_gem(value)
         | 
| 15 | 
            +
                when :file
         | 
| 16 | 
            +
                  result, name, version = GemManager.install_file(value)
         | 
| 17 | 
            +
                else
         | 
| 18 | 
            +
                  raise "invalid parameter: by => #{by}" 
         | 
| 19 | 
            +
                end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                unless Application.first(:name => name, :version => version)
         | 
| 22 | 
            +
                  Application.create({
         | 
| 23 | 
            +
                    :pid => nil,
         | 
| 24 | 
            +
                    :port => 30000 + rand(9999),
         | 
| 25 | 
            +
                    :name => name,
         | 
| 26 | 
            +
                    :version => version,
         | 
| 27 | 
            +
                  })
         | 
| 28 | 
            +
                end
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                return result
         | 
| 31 | 
            +
              end
         | 
| 32 | 
            +
             | 
| 33 | 
            +
              # Uninstall the gem and destroy myself
         | 
| 34 | 
            +
              def uninstall
         | 
| 35 | 
            +
                result = GemManager.uninstall(self.name, self.version)
         | 
| 36 | 
            +
                self.destroy
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                return result
         | 
| 39 | 
            +
              end
         | 
| 40 | 
            +
             | 
| 41 | 
            +
              # Start the app in background
         | 
| 10 42 | 
             
              def start
         | 
| 11 43 | 
             
                return if self.pid
         | 
| 12 44 |  | 
| @@ -26,6 +58,7 @@ class Application | |
| 26 58 | 
             
                self.save
         | 
| 27 59 | 
             
              end
         | 
| 28 60 |  | 
| 61 | 
            +
              # Kill the app if running
         | 
| 29 62 | 
             
              def stop
         | 
| 30 63 | 
             
                if self.pid
         | 
| 31 64 | 
             
                  Servant.kill(self.pid)
         | 
| @@ -33,6 +66,7 @@ class Application | |
| 33 66 | 
             
                end
         | 
| 34 67 | 
             
              end
         | 
| 35 68 |  | 
| 69 | 
            +
              # Returns a string contains name and version
         | 
| 36 70 | 
             
              def full_name
         | 
| 37 71 | 
             
                "#{self.name}-#{self.version}"
         | 
| 38 72 | 
             
              end
         | 
| @@ -59,4 +93,4 @@ class Application | |
| 59 93 | 
             
            end
         | 
| 60 94 | 
             
            DataMapper.auto_upgrade!
         | 
| 61 95 |  | 
| 62 | 
            -
            Application.all.each{|a| a. | 
| 96 | 
            +
            Application.all.each{|a| a.update(:pid => nil)}
         | 
    
        data/model/init.rb
    CHANGED
    
    
    
        data/ruby-station.gemspec
    CHANGED
    
    | @@ -5,21 +5,18 @@ | |
| 5 5 |  | 
| 6 6 | 
             
            Gem::Specification.new do |s|
         | 
| 7 7 | 
             
              s.name = %q{ruby-station}
         | 
| 8 | 
            -
              s.version = "0.1. | 
| 8 | 
            +
              s.version = "0.1.4.rc1"
         | 
| 9 9 |  | 
| 10 10 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 11 11 | 
             
              s.authors = ["Yutaka HARA"]
         | 
| 12 | 
            -
              s.date = %q{2009-10- | 
| 12 | 
            +
              s.date = %q{2009-10-18}
         | 
| 13 13 | 
             
              s.default_executable = %q{ruby-station}
         | 
| 14 14 | 
             
              s.description = %q{Create, Distribute, and Install Ruby applications easily}
         | 
| 15 15 | 
             
              s.email = %q{yutaka.hara/at/gmail.com}
         | 
| 16 16 | 
             
              s.executables = ["ruby-station"]
         | 
| 17 | 
            -
              s.extra_rdoc_files = [
         | 
| 18 | 
            -
                "ChangeLog"
         | 
| 19 | 
            -
              ]
         | 
| 20 17 | 
             
              s.files = [
         | 
| 21 18 | 
             
                ".gitignore",
         | 
| 22 | 
            -
                 " | 
| 19 | 
            +
                 "History.txt",
         | 
| 23 20 | 
             
                 "Rakefile",
         | 
| 24 21 | 
             
                 "VERSION",
         | 
| 25 22 | 
             
                 "bin/ruby-station",
         | 
| @@ -40,22 +37,30 @@ Gem::Specification.new do |s| | |
| 40 37 | 
             
                 "runtime/Rakefile",
         | 
| 41 38 | 
             
                 "runtime/VERSION",
         | 
| 42 39 | 
             
                 "runtime/lib/ruby-station.rb",
         | 
| 43 | 
            -
                 "runtime/ | 
| 44 | 
            -
                 "runtime/ | 
| 45 | 
            -
                 "runtime/ruby-station-runtime-0.0.4.gem",
         | 
| 40 | 
            +
                 "runtime/ruby-station-runtime-0.0.5.gem",
         | 
| 41 | 
            +
                 "runtime/ruby-station-runtime.gemspec",
         | 
| 46 42 | 
             
                 "sample.config.yaml",
         | 
| 47 43 | 
             
                 "tests/README",
         | 
| 48 44 | 
             
                 "tests/Rakefile",
         | 
| 45 | 
            +
                 "tests/console.rb",
         | 
| 49 46 | 
             
                 "tests/data/conf_dir/config.yaml",
         | 
| 47 | 
            +
                 "tests/data/hello/hello-ruby-station.gemspec",
         | 
| 48 | 
            +
                 "tests/data/hello/main.rb",
         | 
| 49 | 
            +
                 "tests/data/hello/pkg/hello-ruby-station-0.3.1.gem",
         | 
| 50 | 
            +
                 "tests/data/hello/pkg/hello-ruby-station-0.3.2.gem",
         | 
| 51 | 
            +
                 "tests/development/config.yaml",
         | 
| 50 52 | 
             
                 "tests/features/install_file.feature",
         | 
| 51 53 | 
             
                 "tests/features/install_name.feature",
         | 
| 52 54 | 
             
                 "tests/features/list.feature",
         | 
| 55 | 
            +
                 "tests/features/reinstall.feature",
         | 
| 53 56 | 
             
                 "tests/features/step_definitions/application_steps.rb",
         | 
| 54 | 
            -
                 "tests/features/step_definitions/ | 
| 57 | 
            +
                 "tests/features/step_definitions/culerity_steps.rb",
         | 
| 55 58 | 
             
                 "tests/features/support/env.rb",
         | 
| 56 59 | 
             
                 "tests/features/uninstall.feature",
         | 
| 57 60 | 
             
                 "tests/features/upgrade.feature",
         | 
| 61 | 
            +
                 "tests/spec/application.rb",
         | 
| 58 62 | 
             
                 "tests/spec/gem_manager.rb",
         | 
| 63 | 
            +
                 "tests/spec/servant.rb",
         | 
| 59 64 | 
             
                 "tests/test_helper.rb",
         | 
| 60 65 | 
             
                 "util/gem_manager.rb",
         | 
| 61 66 | 
             
                 "util/servant.rb",
         | 
| @@ -77,23 +82,32 @@ Gem::Specification.new do |s| | |
| 77 82 | 
             
                s.specification_version = 3
         | 
| 78 83 |  | 
| 79 84 | 
             
                if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
         | 
| 80 | 
            -
                  s.add_runtime_dependency(%q<ramaze>, [" | 
| 81 | 
            -
                  s.add_runtime_dependency(%q<dm-core>, [" | 
| 82 | 
            -
                  s.add_runtime_dependency(%q<do_sqlite3>, [" | 
| 83 | 
            -
                  s.add_development_dependency(%q<rspec>, [" | 
| 84 | 
            -
                  s.add_development_dependency(%q<cucumber>, [" | 
| 85 | 
            +
                  s.add_runtime_dependency(%q<ramaze>, ["= 2009.07"])
         | 
| 86 | 
            +
                  s.add_runtime_dependency(%q<dm-core>, ["= 0.10.1"])
         | 
| 87 | 
            +
                  s.add_runtime_dependency(%q<do_sqlite3>, ["= 0.10.0"])
         | 
| 88 | 
            +
                  s.add_development_dependency(%q<rspec>, ["= 1.2.9"])
         | 
| 89 | 
            +
                  s.add_development_dependency(%q<cucumber>, ["= 0.4.2"])
         | 
| 90 | 
            +
                  s.add_development_dependency(%q<rack-test>, ["= 0.5.0"])
         | 
| 91 | 
            +
                  s.add_development_dependency(%q<webrat>, ["= 0.5.3"])
         | 
| 92 | 
            +
                  s.add_development_dependency(%q<culerity>, ["= 0.2.3"])
         | 
| 85 93 | 
             
                else
         | 
| 86 | 
            -
                  s.add_dependency(%q<ramaze>, [" | 
| 87 | 
            -
                  s.add_dependency(%q<dm-core>, [" | 
| 88 | 
            -
                  s.add_dependency(%q<do_sqlite3>, [" | 
| 89 | 
            -
                  s.add_dependency(%q<rspec>, [" | 
| 90 | 
            -
                  s.add_dependency(%q<cucumber>, [" | 
| 94 | 
            +
                  s.add_dependency(%q<ramaze>, ["= 2009.07"])
         | 
| 95 | 
            +
                  s.add_dependency(%q<dm-core>, ["= 0.10.1"])
         | 
| 96 | 
            +
                  s.add_dependency(%q<do_sqlite3>, ["= 0.10.0"])
         | 
| 97 | 
            +
                  s.add_dependency(%q<rspec>, ["= 1.2.9"])
         | 
| 98 | 
            +
                  s.add_dependency(%q<cucumber>, ["= 0.4.2"])
         | 
| 99 | 
            +
                  s.add_dependency(%q<rack-test>, ["= 0.5.0"])
         | 
| 100 | 
            +
                  s.add_dependency(%q<webrat>, ["= 0.5.3"])
         | 
| 101 | 
            +
                  s.add_dependency(%q<culerity>, ["= 0.2.3"])
         | 
| 91 102 | 
             
                end
         | 
| 92 103 | 
             
              else
         | 
| 93 | 
            -
                s.add_dependency(%q<ramaze>, [" | 
| 94 | 
            -
                s.add_dependency(%q<dm-core>, [" | 
| 95 | 
            -
                s.add_dependency(%q<do_sqlite3>, [" | 
| 96 | 
            -
                s.add_dependency(%q<rspec>, [" | 
| 97 | 
            -
                s.add_dependency(%q<cucumber>, [" | 
| 104 | 
            +
                s.add_dependency(%q<ramaze>, ["= 2009.07"])
         | 
| 105 | 
            +
                s.add_dependency(%q<dm-core>, ["= 0.10.1"])
         | 
| 106 | 
            +
                s.add_dependency(%q<do_sqlite3>, ["= 0.10.0"])
         | 
| 107 | 
            +
                s.add_dependency(%q<rspec>, ["= 1.2.9"])
         | 
| 108 | 
            +
                s.add_dependency(%q<cucumber>, ["= 0.4.2"])
         | 
| 109 | 
            +
                s.add_dependency(%q<rack-test>, ["= 0.5.0"])
         | 
| 110 | 
            +
                s.add_dependency(%q<webrat>, ["= 0.5.3"])
         | 
| 111 | 
            +
                s.add_dependency(%q<culerity>, ["= 0.2.3"])
         | 
| 98 112 | 
             
              end
         | 
| 99 113 | 
             
            end
         | 
    
        data/runtime/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0.0. | 
| 1 | 
            +
            0.0.5
         | 
    
        data/runtime/lib/ruby-station.rb
    CHANGED
    
    
| Binary file | 
| @@ -0,0 +1,26 @@ | |
| 1 | 
            +
            # -*- encoding: utf-8 -*-
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            Gem::Specification.new do |s|
         | 
| 4 | 
            +
              s.name = %q{ruby-station-runtime}
         | 
| 5 | 
            +
              s.version = "0.0.5"
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 8 | 
            +
              s.authors = ["Yutaka HARA"]
         | 
| 9 | 
            +
              s.date = %q{2009-10-08}
         | 
| 10 | 
            +
              s.email = %q{yutaka.hara/at/gmail.com}
         | 
| 11 | 
            +
              s.files = ["Rakefile", "lib/ruby-station", "lib/ruby-station/helper", "lib/ruby-station.rb"]
         | 
| 12 | 
            +
              s.has_rdoc = false
         | 
| 13 | 
            +
              s.require_paths = ["lib"]
         | 
| 14 | 
            +
              s.rubygems_version = %q{1.3.5}
         | 
| 15 | 
            +
              s.summary = %q{Runtime library for RubyStation}
         | 
| 16 | 
            +
             | 
| 17 | 
            +
              if s.respond_to? :specification_version then
         | 
| 18 | 
            +
                current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
         | 
| 19 | 
            +
                s.specification_version = 3
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
         | 
| 22 | 
            +
                else
         | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
              else
         | 
| 25 | 
            +
              end
         | 
| 26 | 
            +
            end
         | 
    
        data/sample.config.yaml
    CHANGED
    
    
    
        data/tests/README
    CHANGED
    
    | @@ -1,28 +1,31 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
             | 
| 1 | 
            +
            How to run tests of RubyStation
         | 
| 2 | 
            +
            ===============================
         | 
| 3 3 |  | 
| 4 | 
            -
             | 
| 4 | 
            +
            Spec
         | 
| 5 5 | 
             
            ----
         | 
| 6 6 |  | 
| 7 | 
            +
            1. install rspec
         | 
| 7 8 | 
             
                $ gem intall rspec
         | 
| 8 9 |  | 
| 9 | 
            -
             | 
| 10 | 
            +
            2. run test
         | 
| 10 11 |  | 
| 12 | 
            +
                $ rake spec
         | 
| 11 13 |  | 
| 12 | 
            -
             | 
| 14 | 
            +
            Features
         | 
| 13 15 | 
             
            --------
         | 
| 14 16 |  | 
| 15 17 | 
             
            1. install cucumber:
         | 
| 16 18 | 
             
                $ gem install cucumber
         | 
| 17 19 |  | 
| 18 | 
            -
            2. install jruby | 
| 19 | 
            -
                TODO
         | 
| 20 | 
            +
            2. install jruby (http://jruby.org/)
         | 
| 20 21 |  | 
| 21 22 | 
             
            JRuby must be executable by 'jruby'.
         | 
| 22 23 |  | 
| 23 24 | 
             
            3. install culerity:
         | 
| 24 25 | 
             
                $ gem install langalex-culerity --source http://gems.github.com
         | 
| 25 26 |  | 
| 27 | 
            +
            4. run test
         | 
| 28 | 
            +
                $ rake cucumber
         | 
| 26 29 |  | 
| 27 30 |  | 
| 28 31 |  | 
    
        data/tests/Rakefile
    CHANGED
    
    | @@ -5,7 +5,18 @@ Cucumber::Rake::Task.new do |t| | |
| 5 5 | 
             
              t.cucumber_opts = %w{--format pretty}
         | 
| 6 6 | 
             
            end
         | 
| 7 7 |  | 
| 8 | 
            +
            desc "run cucumber with cucumber-1.9"
         | 
| 9 | 
            +
            task "cucumber-1.9" do
         | 
| 10 | 
            +
              cd "features/"
         | 
| 11 | 
            +
              sh "cucumber-1.9 *.feature"
         | 
| 12 | 
            +
            end
         | 
| 13 | 
            +
             | 
| 8 14 | 
             
            desc "run rspec"
         | 
| 9 15 | 
             
            task "spec" do
         | 
| 10 16 | 
             
              sh "spec spec/*.rb"
         | 
| 11 17 | 
             
            end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
            desc "run rspec with spec-1.9"
         | 
| 20 | 
            +
            task "spec-1.9" do
         | 
| 21 | 
            +
              sh "spec-1.9 spec/*.rb"
         | 
| 22 | 
            +
            end
         | 
    
        data/tests/console.rb
    ADDED
    
    
| @@ -2,6 +2,8 @@ | |
| 2 2 | 
             
            :gem_command: "gem"
         | 
| 3 3 | 
             
            :gem_dir: "../../tmp/gem_home"
         | 
| 4 4 | 
             
            :gem_bin_dir: "../../tmp/gem_bin"
         | 
| 5 | 
            -
            : | 
| 5 | 
            +
            :db_path: "../../tmp/ruby-station.db"
         | 
| 6 6 | 
             
            :data_dir: "../../tmp/data"
         | 
| 7 | 
            -
            : | 
| 7 | 
            +
            :gem_install_option: "--no-rdoc --no-ri --verbose"
         | 
| 8 | 
            +
            :server_port: 7001
         | 
| 9 | 
            +
            :debug: true
         | 
| @@ -0,0 +1,34 @@ | |
| 1 | 
            +
            # -*- encoding: utf-8 -*-
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            Gem::Specification.new do |s|
         | 
| 4 | 
            +
              s.name = %q{hello-ruby-station}
         | 
| 5 | 
            +
              s.version = "0.3.2"
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 8 | 
            +
              s.authors = ["Yutaka HARA"]
         | 
| 9 | 
            +
              s.date = %q{2009-10-02}
         | 
| 10 | 
            +
              s.description = %q{Greets you}
         | 
| 11 | 
            +
              s.email = %q{yutaka.hara/at/gmail.com}
         | 
| 12 | 
            +
              s.files = [
         | 
| 13 | 
            +
                 "hello-ruby-station.gemspec",
         | 
| 14 | 
            +
                 "main.rb"
         | 
| 15 | 
            +
              ]
         | 
| 16 | 
            +
              s.homepage = %q{}
         | 
| 17 | 
            +
              s.rdoc_options = ["--charset=UTF-8"]
         | 
| 18 | 
            +
              s.require_paths = ["lib"]
         | 
| 19 | 
            +
              s.rubygems_version = %q{1.3.5}
         | 
| 20 | 
            +
              s.summary = %q{Greets you}
         | 
| 21 | 
            +
             | 
| 22 | 
            +
              if s.respond_to? :specification_version then
         | 
| 23 | 
            +
                current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
         | 
| 24 | 
            +
                s.specification_version = 3
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
         | 
| 27 | 
            +
                  s.add_runtime_dependency(%q<sinatra>, [">= 0"])
         | 
| 28 | 
            +
                else
         | 
| 29 | 
            +
                  s.add_dependency(%q<sinatra>, [">= 0"])
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
              else
         | 
| 32 | 
            +
                s.add_dependency(%q<sinatra>, [">= 0"])
         | 
| 33 | 
            +
              end
         | 
| 34 | 
            +
            end
         | 
| @@ -0,0 +1,15 @@ | |
| 1 | 
            +
            require 'optparse'
         | 
| 2 | 
            +
            require 'rubygems'
         | 
| 3 | 
            +
            require 'ruby-station'; RubyStation.parse_argv
         | 
| 4 | 
            +
            require 'sinatra'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            File.open("#{RubyStation.data_dir}/hello.txt", "w"){|f|
         | 
| 7 | 
            +
              f.print "hello"
         | 
| 8 | 
            +
            }
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            get '/' do
         | 
| 11 | 
            +
              'Hello, world!'
         | 
| 12 | 
            +
            end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
            set :port, RubyStation.port
         | 
| 15 | 
            +
             | 
| Binary file | 
| Binary file | 
| @@ -4,11 +4,11 @@ Feature: Install by file | |
| 4 4 | 
             
              I want to install a new gem file
         | 
| 5 5 |  | 
| 6 6 | 
             
              Scenario: Install a gem by file
         | 
| 7 | 
            -
                Given I do not have 'hello 0.2.0'
         | 
| 7 | 
            +
                Given I do not have 'hello-ruby-station 0.2.0'
         | 
| 8 8 | 
             
                And I visit the index page
         | 
| 9 9 | 
             
                And I check 'by file'
         | 
| 10 | 
            -
                And I fill in the path of 'data/hello/pkg/hello-0.2. | 
| 10 | 
            +
                And I fill in the path of 'data/hello/pkg/hello-ruby-station-0.3.2.gem' for 'gem'
         | 
| 11 11 | 
             
                When I press 'install'
         | 
| 12 12 | 
             
                And I wait while the spinner is shown
         | 
| 13 13 | 
             
                Then I should see 'Installing'
         | 
| 14 | 
            -
                And I should have 'hello 0.2 | 
| 14 | 
            +
                And I should have 'hello-ruby-station 0.3.2'
         | 
    
        data/tests/features/list.feature
    CHANGED
    
    | @@ -1,11 +1,10 @@ | |
| 1 | 
            -
            Feature:  | 
| 1 | 
            +
            Feature: Listing
         | 
| 2 2 | 
             
              In order to know which application is installed
         | 
| 3 3 | 
             
              As an application user
         | 
| 4 4 | 
             
              I want to list my applications
         | 
| 5 5 |  | 
| 6 6 | 
             
              Scenario: View the list of applications
         | 
| 7 | 
            -
                Given I  | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            -
             | 
| 11 | 
            -
            #    Then I should see 'Answer: 120'
         | 
| 7 | 
            +
                Given I have 'hello-ruby-station 0.3.1'
         | 
| 8 | 
            +
                When I visit the index page
         | 
| 9 | 
            +
                Then I should see 'hello-ruby-station'
         | 
| 10 | 
            +
                And I should see '0.3.1'
         | 
| @@ -0,0 +1,10 @@ | |
| 1 | 
            +
            Feature: Re-Install
         | 
| 2 | 
            +
              In order to be sure the app is installed
         | 
| 3 | 
            +
              As an application user
         | 
| 4 | 
            +
              I want to install the app again
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              Scenario: Reinstalling a gem
         | 
| 7 | 
            +
                Given I have 'hello-ruby-station 0.3.1' and its data
         | 
| 8 | 
            +
                When I install 'hello-ruby-station 0.3.1'
         | 
| 9 | 
            +
                Then I should still have 'hello-ruby-station 0.3.1'
         | 
| 10 | 
            +
                And data files of 'hello-ruby-station 0.3.1' should exist
         |