sashimi 0.2.0 → 0.2.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.
data/CHANGELOG CHANGED
@@ -1,3 +1,25 @@
1
+ * *v0.2.1*
2
+
3
+ * Tagged v0.2.1
4
+
5
+ * Prepare for v0.2.1
6
+
7
+ * CHANGELOG massive update
8
+
9
+ * Use hardcoded file list for sashimi.gemspec
10
+
11
+ * Give a more informative message when Svn or Git is not installed on the system
12
+
13
+ * Make sure to load AbstractRepository first. [#15 state:resolved]
14
+
15
+ * Print on stdout the name of the remote repository while executing Git Rake tasks
16
+
17
+ * Created Git related Rake tasks
18
+
19
+ * Created dist and clean Rake tasks
20
+
21
+
22
+
1
23
  * *v0.2.0*
2
24
 
3
25
  * Tagged v0.2.0
data/Rakefile CHANGED
@@ -3,6 +3,8 @@ require 'rake'
3
3
  require 'rake/testtask'
4
4
  require 'rake/rdoctask'
5
5
 
6
+ repositories = %w( origin rubyforge )
7
+
6
8
  desc 'Default: run unit tests.'
7
9
  task :default => :test
8
10
 
@@ -30,3 +32,53 @@ task :install do
30
32
  system "sudo gem install --local --no-rdoc --no-ri sashimi-#{Sashimi::VERSION::STRING}.gem"
31
33
  system "rm sashimi-*.gem"
32
34
  end
35
+
36
+ desc 'Build and prepare files for release.'
37
+ task :dist => :clean do
38
+ require 'sashimi'
39
+ system "gem build sashimi.gemspec"
40
+ system "cd .. && tar -czf sashimi-#{Sashimi::VERSION::STRING}.tar.gz sashimi"
41
+ system "cd .. && tar -cjf sashimi-#{Sashimi::VERSION::STRING}.tar.bz2 sashimi"
42
+ system "cd .. && cp sashimi-* sashimi"
43
+ end
44
+
45
+ desc 'Clean the working copy from release files.'
46
+ task :clean do
47
+ require 'sashimi'
48
+ version = Sashimi::VERSION::STRING
49
+ system "rm sashimi-#{version}.gem" if File.exist? "sashimi-#{version}.gem"
50
+ system "rm sashimi-#{version}.tar.gz" if File.exist? "sashimi-#{version}.tar.gz"
51
+ system "rm sashimi-#{version}.tar.bz2" if File.exist? "sashimi-#{version}.tar.bz2"
52
+ end
53
+
54
+ desc 'Show the file list for the gemspec file'
55
+ task :files do
56
+ puts "Files:\n #{Dir['**/*'].reject {|f| File.directory?(f)}.sort.inspect}"
57
+ puts "Test files:\n #{Dir['test/**/*_test.rb'].reject {|f| File.directory?(f)}.sort.inspect}"
58
+ end
59
+
60
+ namespace :git do
61
+ desc 'Push local Git commits to all remote centralized repositories.'
62
+ task :push do
63
+ repositories.each do |repository|
64
+ puts "Pushing #{repository}...\n"
65
+ system "git push #{repository} master"
66
+ end
67
+ end
68
+
69
+ desc 'Perform a git-tag'
70
+ task :tag do
71
+ puts "Please enter the tag name: "
72
+ tag_name = STDIN.gets.chomp
73
+ exit(1) if tag_name.nil? or tag_name.empty?
74
+ system "git tag -s #{tag_name}"
75
+ end
76
+
77
+ desc 'Push all the tags to remote centralized repositories.'
78
+ task :push_tags do
79
+ repositories.each do |repository|
80
+ puts "Pushing tags to #{repository}...\n"
81
+ system "git push --tags #{repository}"
82
+ end
83
+ end
84
+ end
@@ -8,6 +8,20 @@ module Sashimi
8
8
  @message || @plugin_name.to_s + " isn't in the local repository."
9
9
  end
10
10
  end
11
+
12
+ class ClientNotFound < StandardError #:nodoc:
13
+ def initialize(message = nil)
14
+ @message = message
15
+ end
16
+
17
+ def client
18
+ self.class.name.demodulize.gsub(/NotFound/, '')
19
+ end
20
+
21
+ def to_s
22
+ @message || "#{client} wasn't installed or it isn't in your load path."
23
+ end
24
+ end
11
25
 
12
26
  class AbstractRepository
13
27
  TEMP_SUFFIX = '-tmp'
@@ -1,11 +1,14 @@
1
1
  module Sashimi
2
+ class GitNotFound < ClientNotFound; end #:nodoc:
3
+
2
4
  class GitRepository < AbstractRepository
3
5
  # Install the +plugin+.
4
6
  def install
5
7
  prepare_installation
6
8
  puts plugin.guess_name.titleize + "\n\n"
7
9
  with_path local_repository_path do
8
- Kernel.system("git clone #{plugin.url}")
10
+ result = Kernel.system("git clone #{plugin.url}")
11
+ raise GitNotFound unless !!result
9
12
  add_to_cache(plugin.to_hash)
10
13
  end
11
14
  end
@@ -14,7 +17,8 @@ module Sashimi
14
17
  def update
15
18
  puts plugin.name.titleize + "\n\n"
16
19
  with_path plugin_path do
17
- Kernel.system('git pull')
20
+ result = Kernel.system('git pull')
21
+ raise GitNotFound unless !!result
18
22
  end
19
23
  end
20
24
  end
@@ -1,11 +1,14 @@
1
1
  module Sashimi
2
+ class SvnNotFound < ClientNotFound; end #:nodoc:
3
+
2
4
  class SvnRepository < AbstractRepository
3
5
  # Install the +plugin+.
4
6
  def install
5
7
  prepare_installation
6
8
  puts plugin.guess_name.titleize + "\n\n"
7
9
  with_path local_repository_path do
8
- Kernel.system("svn co #{plugin.url} #{plugin.guess_name}")
10
+ result = Kernel.system("svn co #{plugin.url} #{plugin.guess_name}")
11
+ raise SvnNotFound unless !!result
9
12
  add_to_cache(plugin.to_hash)
10
13
  end
11
14
  end
@@ -14,7 +17,8 @@ module Sashimi
14
17
  def update
15
18
  puts plugin.name.titleize + "\n\n"
16
19
  with_path plugin_path do
17
- Kernel.system("svn up")
20
+ result = Kernel.system("svn up")
21
+ raise SvnNotFound unless !!result
18
22
  end
19
23
  end
20
24
  end
@@ -1 +1 @@
1
- Dir[File.dirname(__FILE__) + '/repositories/*.rb'].each{|f| require f}
1
+ Dir[File.dirname(__FILE__) + '/repositories/*.rb'].sort.each{|f| require f}
@@ -2,7 +2,7 @@ module Sashimi #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/sashimi.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "sashimi"
3
- s.version = "0.2.0"
4
- s.date = "2008-07-14"
3
+ s.version = "0.2.1"
4
+ s.date = "2008-09-29"
5
5
  s.summary = "Rails plugins manager"
6
6
  s.author = "Luca Guidi"
7
7
  s.email = "guidi.luca@gmail.com"
@@ -10,8 +10,22 @@ Gem::Specification.new do |s|
10
10
  s.has_rdoc = true
11
11
  s.rubyforge_project = %q{sashimi}
12
12
  s.executables = [ 'sashimi' ]
13
- s.files = Dir['**/*'].reject {|f| File.directory?(f)}.sort
14
- s.test_files = Dir['test/**/*_test.rb'].reject {|f| File.directory?(f)}.sort
13
+ s.files = ["CHANGELOG", "MIT-LICENSE", "README", "Rakefile", "bin/sashimi",
14
+ "lib/sashimi.rb", "lib/sashimi/commands.rb", "lib/sashimi/core_ext.rb",
15
+ "lib/sashimi/core_ext/array.rb", "lib/sashimi/core_ext/class.rb",
16
+ "lib/sashimi/core_ext/string.rb", "lib/sashimi/plugin.rb", "lib/sashimi/repositories.rb",
17
+ "lib/sashimi/repositories/abstract_repository.rb", "lib/sashimi/repositories/git_repository.rb",
18
+ "lib/sashimi/repositories/svn_repository.rb", "lib/sashimi/version.rb", "sashimi.gemspec",
19
+ "setup.rb", "test/test_helper.rb", "test/unit/core_ext/array_test.rb",
20
+ "test/unit/core_ext/class_test.rb", "test/unit/core_ext/string_test.rb",
21
+ "test/unit/plugin_test.rb", "test/unit/repositories/abstract_repository_test.rb",
22
+ "test/unit/repositories/git_repository_test.rb", "test/unit/repositories/svn_repository_test.rb",
23
+ "test/unit/version_test.rb"]
24
+ s.test_files = ["test/unit/core_ext/array_test.rb", "test/unit/core_ext/class_test.rb",
25
+ "test/unit/core_ext/string_test.rb", "test/unit/plugin_test.rb",
26
+ "test/unit/repositories/abstract_repository_test.rb",
27
+ "test/unit/repositories/git_repository_test.rb", "test/unit/repositories/svn_repository_test.rb",
28
+ "test/unit/version_test.rb"]
15
29
  s.extra_rdoc_files = ['README', 'CHANGELOG']
16
30
 
17
31
  s.add_dependency("activesupport", ["> 0.0.0"])
@@ -22,11 +22,18 @@ class GitRepositoryTest < Test::Unit::TestCase
22
22
  def test_should_create_git_repository
23
23
  repository.with_path plugins_path do
24
24
  FileUtils.mkdir_p('sashimi')
25
- Kernel.expects(:system).with('git clone git://github.com/jodosha/sashimi.git')
25
+ Kernel.expects(:system).with('git clone git://github.com/jodosha/sashimi.git').returns true
26
26
  GitRepository.new(plugin).install
27
27
  File.expects(:exists?).with('.git').returns(true)
28
28
  assert File.exists?('.git')
29
29
  end
30
+ end
31
+
32
+ def test_should_raise_exception_if_git_was_not_available
33
+ assert_raise Sashimi::GitNotFound do
34
+ Kernel.expects(:system).with('git clone git://github.com/jodosha/sashimi.git').returns false
35
+ GitRepository.new(plugin).install
36
+ end
30
37
  end
31
38
  end
32
39
  end
@@ -22,11 +22,18 @@ class SvnRepositoryTest < Test::Unit::TestCase
22
22
  def test_should_create_svn_repository
23
23
  repository.with_path plugins_path do
24
24
  FileUtils.mkdir_p('sashimi')
25
- Kernel.expects(:system).with('svn co http://dev.repository.com/svn/sashimi/trunk sashimi')
25
+ Kernel.expects(:system).with('svn co http://dev.repository.com/svn/sashimi/trunk sashimi').returns true
26
26
  SvnRepository.new(create_plugin(nil, 'http://dev.repository.com/svn/sashimi/trunk')).install
27
27
  File.expects(:exists?).with('.svn').returns(true)
28
28
  assert File.exists?('.svn')
29
29
  end
30
- end
30
+ end
31
+
32
+ def test_should_raise_exception_if_svn_was_not_available
33
+ assert_raise Sashimi::SvnNotFound do
34
+ Kernel.expects(:system).with('svn co http://dev.repository.com/svn/sashimi/trunk sashimi').returns false
35
+ SvnRepository.new(create_plugin(nil, 'http://dev.repository.com/svn/sashimi/trunk')).install
36
+ end
37
+ end
31
38
  end
32
39
  end
@@ -3,6 +3,6 @@ require 'test/test_helper'
3
3
 
4
4
  class VersionTest < Test::Unit::TestCase
5
5
  def test_version
6
- assert_equal '0.2.0', Sashimi::VERSION::STRING
6
+ assert_equal '0.2.1', Sashimi::VERSION::STRING
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sashimi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
@@ -9,11 +9,12 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-07-14 00:00:00 +02:00
12
+ date: 2008-09-29 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
17
+ type: :runtime
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements:
@@ -81,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
82
  requirements: []
82
83
 
83
84
  rubyforge_project: sashimi
84
- rubygems_version: 1.1.1
85
+ rubygems_version: 1.2.0
85
86
  signing_key:
86
87
  specification_version: 2
87
88
  summary: Rails plugins manager