jodosha-sashimi 0.1.5 → 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 +138 -0
- data/README +27 -25
- data/Rakefile +62 -0
- data/lib/sashimi/commands.rb +5 -1
- data/lib/sashimi/core_ext/array.rb +22 -0
- data/lib/sashimi/core_ext/class.rb +31 -0
- data/lib/sashimi/core_ext/string.rb +13 -0
- data/lib/sashimi/core_ext.rb +1 -0
- data/lib/sashimi/plugin.rb +3 -4
- data/lib/sashimi/repositories/abstract_repository.rb +138 -142
- data/lib/sashimi/repositories/git_repository.rb +13 -4
- data/lib/sashimi/repositories/svn_repository.rb +13 -4
- data/lib/sashimi/repositories.rb +1 -1
- data/lib/sashimi/version.rb +9 -0
- data/lib/sashimi.rb +24 -0
- data/sashimi.gemspec +19 -4
- data/test/test_helper.rb +127 -30
- data/test/unit/core_ext/array_test.rb +22 -0
- data/test/unit/core_ext/class_test.rb +29 -0
- data/test/unit/core_ext/string_test.rb +20 -0
- data/test/unit/plugin_test.rb +4 -5
- data/test/unit/repositories/abstract_repository_test.rb +254 -79
- data/test/unit/repositories/git_repository_test.rb +32 -1
- data/test/unit/repositories/svn_repository_test.rb +32 -1
- data/test/unit/version_test.rb +8 -0
- metadata +22 -9
data/CHANGELOG
CHANGED
|
@@ -1,3 +1,141 @@
|
|
|
1
|
+
* Prepare for v0.2.1
|
|
2
|
+
|
|
3
|
+
* CHANGELOG massive update
|
|
4
|
+
|
|
5
|
+
* Use hardcoded file list for sashimi.gemspec
|
|
6
|
+
|
|
7
|
+
* Give a more informative message when Svn or Git is not installed on the system
|
|
8
|
+
|
|
9
|
+
* Make sure to load AbstractRepository first. [#15 state:resolved]
|
|
10
|
+
|
|
11
|
+
* Print on stdout the name of the remote repository while executing Git Rake tasks
|
|
12
|
+
|
|
13
|
+
* Created Git related Rake tasks
|
|
14
|
+
|
|
15
|
+
* Created dist and clean Rake tasks
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
* *v0.2.0*
|
|
20
|
+
|
|
21
|
+
* Tagged v0.2.0
|
|
22
|
+
|
|
23
|
+
* Prepare for v0.2.0
|
|
24
|
+
|
|
25
|
+
* Ignored flunked test cases
|
|
26
|
+
|
|
27
|
+
* Massive changelog
|
|
28
|
+
|
|
29
|
+
* rdoc formatting
|
|
30
|
+
|
|
31
|
+
* Using, where possible, @@class_variable and cattr_reader instead of class methods. Documentation improvements.
|
|
32
|
+
|
|
33
|
+
* Don't try to remove the gem from working copy at the beginning of Rake install
|
|
34
|
+
|
|
35
|
+
* Print plugin name when execute uninstall command
|
|
36
|
+
|
|
37
|
+
* Aliased #cache_content with #list in order to clean up AbstractRepository from stdout formattin code. The code was moved to Commands::List
|
|
38
|
+
|
|
39
|
+
* Clean up for #with_path in test_helper.rb
|
|
40
|
+
|
|
41
|
+
* Removed with_path from #files_scheduled_for_add and #files_scheduled_for_remove because #update_versioned_rails_plugins already works in vendor/plugins
|
|
42
|
+
|
|
43
|
+
* Removed unnecessary with_path statement from AbstractRepository#prepare_installation
|
|
44
|
+
|
|
45
|
+
* Removed unnecessary with_path statement from AbstractRepository#remove_temp_folder
|
|
46
|
+
|
|
47
|
+
* Removed unnecessary with_path statement from AbstractRepository#update_unversioned_rails_plugins
|
|
48
|
+
|
|
49
|
+
* Removed with_path from #update_rails_plugins, because update command should be always executed from the root of a Rails app
|
|
50
|
+
|
|
51
|
+
* Removed unnecessary with_path statement from AbstractRepository#copy_plugin_to_rails_app
|
|
52
|
+
|
|
53
|
+
* Removed unnecessary with_path statement for AbstractRepository#write_to_cache
|
|
54
|
+
|
|
55
|
+
* Remove builded gem from working copy, after rake install task
|
|
56
|
+
|
|
57
|
+
* Don't generate rdoc and ri on Rake install
|
|
58
|
+
|
|
59
|
+
* Fixed AbstractRepository#update_versioned_rails_plugins. Made AbstractRepository#temp_plugin_name public
|
|
60
|
+
|
|
61
|
+
* Created install Rake task
|
|
62
|
+
|
|
63
|
+
* Improved test coverage for AbstractRepository
|
|
64
|
+
|
|
65
|
+
* Added AbstractRepository#temp_plugin_name
|
|
66
|
+
|
|
67
|
+
* File#join -> Array#to_path or String#to_path. Code cleanup.
|
|
68
|
+
|
|
69
|
+
* Improved tests for AbstractRepository cache and instantiation
|
|
70
|
+
|
|
71
|
+
* Improved test coverage for AbstractRepository
|
|
72
|
+
|
|
73
|
+
* Added tests for uninstall. Re-enabled tests.
|
|
74
|
+
|
|
75
|
+
* Initial rewriting of test suite
|
|
76
|
+
|
|
77
|
+
* Added String#to_path and Array#to_path
|
|
78
|
+
|
|
79
|
+
* Added AbstractRepository#with_path in order to scopify current directory changes
|
|
80
|
+
|
|
81
|
+
* Added block support to Class#class_method_proxy
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
* *v0.1.7*
|
|
86
|
+
|
|
87
|
+
* Tagged v0.1.7
|
|
88
|
+
|
|
89
|
+
* Prepare for v0.1.7
|
|
90
|
+
|
|
91
|
+
* Updated installation instructions in README
|
|
92
|
+
|
|
93
|
+
* Automatic file lists for sashimi.gemspec
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
* *v0.1.6*
|
|
98
|
+
|
|
99
|
+
* Tagged v0.1.6
|
|
100
|
+
|
|
101
|
+
* Prepare for v0.1.6
|
|
102
|
+
|
|
103
|
+
* Massive changelog
|
|
104
|
+
|
|
105
|
+
* Added rubyforge project reference to gemspec
|
|
106
|
+
|
|
107
|
+
* Added sashimi*.gem to .gitignore
|
|
108
|
+
|
|
109
|
+
* Removed AbstractRepository#cache_file, now uses cattr_accessor
|
|
110
|
+
|
|
111
|
+
* Updated annotation for AbstractRepository public methods in test/test_helper.rb
|
|
112
|
+
|
|
113
|
+
* Introduced Class#class_method_proxy in order to make available annotated class methods as private methods
|
|
114
|
+
|
|
115
|
+
Example:
|
|
116
|
+
class Repository
|
|
117
|
+
def self.path
|
|
118
|
+
@@path
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
class_method_proxy :path
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
Produces:
|
|
125
|
+
# Proxy method for <tt>Repository#path</tt>
|
|
126
|
+
def path
|
|
127
|
+
self.class.path
|
|
128
|
+
end
|
|
129
|
+
private :path
|
|
130
|
+
|
|
131
|
+
* Improved tests for repositories system calls
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
* *v0.1.5*
|
|
136
|
+
|
|
137
|
+
* Tagged v0.1.5
|
|
138
|
+
|
|
1
139
|
* Prepare for v0.1.5
|
|
2
140
|
|
|
3
141
|
* Raise a PluginNotFound exception if try to update a not existent plugin for the current Rails app
|
data/README
CHANGED
|
@@ -1,78 +1,80 @@
|
|
|
1
|
-
Sashimi
|
|
2
|
-
=======
|
|
1
|
+
= Sashimi
|
|
3
2
|
|
|
4
3
|
Sashimi is a Rails plugins manager.
|
|
4
|
+
|
|
5
5
|
It allows to install your favourite plugins in a local repository and add them to your Rails apps.
|
|
6
6
|
The main goal is to allow the plugins offline installation.
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
Installation
|
|
11
|
-
|
|
10
|
+
= Installation
|
|
11
|
+
|
|
12
|
+
$ (sudo) gem install sashimi
|
|
13
|
+
|
|
14
|
+
or
|
|
12
15
|
|
|
13
|
-
$ (sudo) gem install jodosha-sashimi --source=http://gems.github.com
|
|
16
|
+
$ (sudo) gem install jodosha-sashimi --source=http://gems.github.com
|
|
14
17
|
|
|
15
18
|
|
|
16
19
|
|
|
17
|
-
Usage
|
|
18
|
-
=====
|
|
20
|
+
= Usage
|
|
19
21
|
|
|
20
22
|
Install a plugin from a subversion URL:
|
|
21
|
-
$ sashimi install http://dev.rubyonrails.com/svn/rails/plugins/continuous_builder
|
|
23
|
+
$ sashimi install http://dev.rubyonrails.com/svn/rails/plugins/continuous_builder
|
|
22
24
|
|
|
23
25
|
Install a plugin from a git URL:
|
|
24
|
-
$ sashimi install git://github.com/jodosha/click-to-globalize.git
|
|
26
|
+
$ sashimi install git://github.com/jodosha/click-to-globalize.git
|
|
25
27
|
|
|
26
28
|
Uninstall a plugin:
|
|
27
|
-
$ sashimi uninstall continuous_builder
|
|
29
|
+
$ sashimi uninstall continuous_builder
|
|
28
30
|
|
|
29
31
|
Update a plugin:
|
|
30
|
-
$ sashimi update click-to-globalize
|
|
32
|
+
$ sashimi update click-to-globalize
|
|
31
33
|
|
|
32
34
|
Update a plugin of a Rails app:
|
|
33
|
-
$ sashimi update --rails click-to-globalize
|
|
35
|
+
$ sashimi update --rails click-to-globalize
|
|
34
36
|
|
|
35
37
|
NOTE: If your application is versioned with Svn or Git, Sashimi will automatically schedules for add/remove the added/removed files.
|
|
36
38
|
|
|
37
39
|
List all installed plugins:
|
|
38
|
-
$ sashimi list
|
|
40
|
+
$ sashimi list
|
|
39
41
|
|
|
40
42
|
Add installed plugin(s) to a Rails app:
|
|
41
|
-
$ sashimi add click-to-globalize
|
|
42
|
-
|
|
43
|
+
$ sashimi add click-to-globalize
|
|
44
|
+
or
|
|
45
|
+
$ sashimi install --rails click-to-globalize
|
|
43
46
|
|
|
44
47
|
|
|
45
48
|
|
|
46
|
-
Known And Common Issues
|
|
47
|
-
=======================
|
|
49
|
+
= Known And Common Issues
|
|
48
50
|
|
|
49
51
|
* When add a plugin to an app, make sure your current directory is the rails root.
|
|
50
52
|
|
|
51
53
|
* Only Subversion and Git repositories are currently supported.
|
|
52
54
|
|
|
53
55
|
|
|
54
|
-
Contribute
|
|
55
|
-
==========
|
|
56
|
+
= Contribute
|
|
56
57
|
|
|
57
58
|
* Check out the code and test it:
|
|
59
|
+
|
|
58
60
|
$ git clone git://github.com/jodosha/sashimi.git
|
|
61
|
+
|
|
59
62
|
$ rake
|
|
60
63
|
|
|
61
|
-
* Create a ticket to
|
|
64
|
+
* Create a ticket to the {Sushistar Lighthouse page}[http://sushistar.lighthouseapp.com]
|
|
62
65
|
|
|
63
66
|
* Create a patch and add as attachement to the ticket.
|
|
64
67
|
|
|
65
68
|
|
|
66
|
-
Credits
|
|
67
|
-
=======
|
|
69
|
+
= Credits
|
|
68
70
|
|
|
69
71
|
Partially inspired to RaPT[http://rapt.rubyforge.org/].
|
|
70
72
|
|
|
71
73
|
|
|
72
74
|
|
|
73
|
-
Home Page
|
|
74
|
-
|
|
75
|
-
http://lucaguidi.com/pages/sashimi
|
|
75
|
+
= Home Page
|
|
76
|
+
|
|
77
|
+
The Sashimi homepage is http://lucaguidi.com/pages/sashimi
|
|
76
78
|
|
|
77
79
|
|
|
78
80
|
|
data/Rakefile
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
$:.unshift 'lib'
|
|
1
2
|
require 'rake'
|
|
2
3
|
require 'rake/testtask'
|
|
3
4
|
require 'rake/rdoctask'
|
|
4
5
|
|
|
6
|
+
repositories = %w( origin rubyforge )
|
|
7
|
+
|
|
5
8
|
desc 'Default: run unit tests.'
|
|
6
9
|
task :default => :test
|
|
7
10
|
|
|
@@ -20,3 +23,62 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
|
20
23
|
rdoc.rdoc_files.include('README')
|
|
21
24
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
22
25
|
end
|
|
26
|
+
|
|
27
|
+
desc 'Build and install the gem (useful for development purposes).'
|
|
28
|
+
task :install do
|
|
29
|
+
require 'sashimi'
|
|
30
|
+
system "gem build sashimi.gemspec"
|
|
31
|
+
system "sudo gem uninstall sashimi"
|
|
32
|
+
system "sudo gem install --local --no-rdoc --no-ri sashimi-#{Sashimi::VERSION::STRING}.gem"
|
|
33
|
+
system "rm sashimi-*.gem"
|
|
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
|
data/lib/sashimi/commands.rb
CHANGED
|
@@ -125,6 +125,7 @@ module Sashimi
|
|
|
125
125
|
def parse!(args)
|
|
126
126
|
options.parse!(args)
|
|
127
127
|
args.each do |name|
|
|
128
|
+
puts name.titleize + "\n"
|
|
128
129
|
Plugin.new(name).uninstall
|
|
129
130
|
end
|
|
130
131
|
end
|
|
@@ -179,7 +180,10 @@ module Sashimi
|
|
|
179
180
|
|
|
180
181
|
def parse!(args)
|
|
181
182
|
options.parse!(args)
|
|
182
|
-
|
|
183
|
+
output = Plugin.list.sort.collect do |plugin, contents|
|
|
184
|
+
"#{plugin}\t\t#{contents['summary']}"
|
|
185
|
+
end.join("\n")
|
|
186
|
+
puts output
|
|
183
187
|
end
|
|
184
188
|
end
|
|
185
189
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
class Array
|
|
2
|
+
# Transform the current +Array+ to a path.
|
|
3
|
+
#
|
|
4
|
+
# It's an alias for <tt>File#join</tt>.
|
|
5
|
+
#
|
|
6
|
+
# %w(path to app).to_path # => path/to/app+
|
|
7
|
+
# %w(path to app).to_path(true) # => /Users/luca/path/to/app
|
|
8
|
+
def to_path(absolute = false)
|
|
9
|
+
path = File.join(self)
|
|
10
|
+
path = File.expand_path(path) if absolute
|
|
11
|
+
path
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Transform the current +Array+ to an absolute path.
|
|
15
|
+
#
|
|
16
|
+
# %w(path to app).to_absolute_path # => /Users/luca/path/to/app
|
|
17
|
+
# %w(path to app).to_abs_path # => /Users/luca/path/to/app
|
|
18
|
+
def to_absolute_path
|
|
19
|
+
to_path(true)
|
|
20
|
+
end
|
|
21
|
+
alias_method :to_abs_path, :to_absolute_path
|
|
22
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
class Class
|
|
2
|
+
# Dinamically creates a proxy for given class methods.
|
|
3
|
+
#
|
|
4
|
+
# Example:
|
|
5
|
+
#
|
|
6
|
+
# class Repository
|
|
7
|
+
# def self.path
|
|
8
|
+
# @@path
|
|
9
|
+
# end
|
|
10
|
+
#
|
|
11
|
+
# class_method_proxy :path
|
|
12
|
+
# end
|
|
13
|
+
#
|
|
14
|
+
# It produces:
|
|
15
|
+
# # Proxy method for <tt>Repository#path</tt>
|
|
16
|
+
# def path
|
|
17
|
+
# self.class.path
|
|
18
|
+
# end
|
|
19
|
+
# private :path
|
|
20
|
+
def class_method_proxy(*method_names)
|
|
21
|
+
method_names.each do |m|
|
|
22
|
+
self.class_eval %{
|
|
23
|
+
# Proxy method for <tt>#{self.class.name}##{m}</tt>
|
|
24
|
+
def #{m}(*args, &block)
|
|
25
|
+
self.class.#{m}(*args, &block)
|
|
26
|
+
end
|
|
27
|
+
private :#{m}
|
|
28
|
+
}, __FILE__, __LINE__
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class String
|
|
2
|
+
# Transform the current +String+ to a system path,
|
|
3
|
+
# according to the current platform file system.
|
|
4
|
+
#
|
|
5
|
+
# "path/to/app".to_path # => path/to/app (on *nix)
|
|
6
|
+
# "path/to/app".to_path # => path\to\app (on Windows)
|
|
7
|
+
#
|
|
8
|
+
# "path/to/app".to_path(true) # => /Users/luca/path/to/app (on *nix)
|
|
9
|
+
# "path/to/app".to_path(true) # => C:\path\to\app (on Windows)
|
|
10
|
+
def to_path(absolute = false)
|
|
11
|
+
self.split(/\/\\/).to_path(absolute)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Dir[File.dirname(__FILE__) + '/core_ext/*.rb'].each{|f| require f}
|
data/lib/sashimi/plugin.rb
CHANGED
|
@@ -30,9 +30,8 @@ module Sashimi
|
|
|
30
30
|
def repository #:nodoc:
|
|
31
31
|
@repository ||= instantiate_repository
|
|
32
32
|
end
|
|
33
|
-
|
|
34
|
-
#
|
|
35
|
-
# New feature of Rails 2.1.x http:://dev.rubyonrails.org/changeset/9098
|
|
33
|
+
|
|
34
|
+
# Returns the informations about the plugin.
|
|
36
35
|
def about
|
|
37
36
|
@about ||= repository.about
|
|
38
37
|
end
|
|
@@ -52,7 +51,7 @@ module Sashimi
|
|
|
52
51
|
name
|
|
53
52
|
end
|
|
54
53
|
|
|
55
|
-
# Serialize the plugin to Hash format.
|
|
54
|
+
# Serialize the plugin to +Hash+ format.
|
|
56
55
|
def to_hash
|
|
57
56
|
{ self.guess_name =>
|
|
58
57
|
{ 'type' => repository.scm_type,
|