minglemingle 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2008 Li Xiao
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ class NilClass
15
+ def blank?
16
+ true
17
+ end
18
+ end
19
+
20
+ class String
21
+ def blank?
22
+ empty?
23
+ end
24
+ end
25
+
26
+ class Array
27
+ def blank?
28
+ empty?
29
+ end
30
+ end
31
+
32
+ module MM
33
+ def cmd_instance(str)
34
+ str = 'svncommit' if str == 'svnci'
35
+ str = 'help' if str == '?'
36
+ cmd_class = str.to_s.downcase.gsub(/(^|_)(.)/) { $2.upcase }
37
+ Object.module_eval("::MM::Command::#{cmd_class}", __FILE__, __LINE__).new
38
+ end
39
+
40
+ module_function :cmd_instance
41
+ end
@@ -0,0 +1,31 @@
1
+ require File.dirname(__FILE__) + '/test_helper'
2
+
3
+ class AbstractCommandTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ MM::Repository.destroy rescue nil
7
+ end
8
+
9
+ def teardown
10
+ MM::Repository.destroy rescue nil
11
+ end
12
+
13
+ def test_cache_options
14
+ card_cmd = MM::Command::Card.new
15
+ card_cmd.parse(['102'])
16
+ card_cmd.cache_options
17
+ assert_equal card_cmd.options, MM::Command::Card.new.options
18
+
19
+ init_cmd = MM::Command::Init.new
20
+ init_cmd.parse(['site url'])
21
+ init_cmd.cache_options
22
+ assert_equal 'site url', MM::Command::Init.new.options[:site]
23
+ end
24
+
25
+ def test_command_options_cache_should_be_independence
26
+ card_cmd = MM::Command::Card.new
27
+ card_cmd.parse(['102'])
28
+ card_cmd.cache_options
29
+ assert_equal({}, MM::Command::User.new.options)
30
+ end
31
+ end
@@ -0,0 +1,26 @@
1
+ require 'test/unit'
2
+ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
3
+
4
+ require 'mm/utils'
5
+ require 'mm/rest_api'
6
+
7
+ require 'mm/cmds/init'
8
+ require 'mm/cmds/run'
9
+ require 'mm/cmds/svncommit'
10
+ require 'mm/cmds/user'
11
+ require 'mm/cmds/card'
12
+ require 'mm/cmds/cards'
13
+ require 'mm/cmds/favorites'
14
+ require 'mm/cmds/tabs'
15
+ require 'mm/cmds/view'
16
+ require 'mm/cmds/help'
17
+
18
+ module Test
19
+ module Unit
20
+ class TestCase
21
+ def assert_false(o)
22
+ assert !o
23
+ end
24
+ end
25
+ end
26
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: minglemingle
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Li Xiao
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-04-18 00:00:00 +08:00
13
+ default_executable: mm
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activeresource
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">"
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.1
23
+ version:
24
+ description:
25
+ email: swing1979@gmail.com
26
+ executables:
27
+ - mm
28
+ extensions: []
29
+
30
+ extra_rdoc_files: []
31
+
32
+ files:
33
+ - install.rb
34
+ - CHANGES
35
+ - LICENSE.TXT
36
+ - Rakefile
37
+ - README
38
+ - TODO
39
+ - bin/mm
40
+ - lib/mm/cmds/abstract_command.rb
41
+ - lib/mm/cmds/card.rb
42
+ - lib/mm/cmds/cards.rb
43
+ - lib/mm/cmds/favorites.rb
44
+ - lib/mm/cmds/help.rb
45
+ - lib/mm/cmds/init.rb
46
+ - lib/mm/cmds/run.rb
47
+ - lib/mm/cmds/svncommit.rb
48
+ - lib/mm/cmds/tabs.rb
49
+ - lib/mm/cmds/user.rb
50
+ - lib/mm/cmds/view.rb
51
+ - lib/mm/repository.rb
52
+ - lib/mm/rest_api.rb
53
+ - lib/mm/transition_execution.tab.rb
54
+ - lib/mm/utils.rb
55
+ - lib/mm.rb
56
+ - test/abstract_command_test.rb
57
+ - test/test_helper.rb
58
+ - doc/jamis.rb
59
+ has_rdoc: true
60
+ homepage: http://minglemingle.rubyforge.org
61
+ post_install_message:
62
+ rdoc_options: []
63
+
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: "0"
71
+ version:
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: "0"
77
+ version:
78
+ requirements: []
79
+
80
+ rubyforge_project: minglemingle
81
+ rubygems_version: 1.0.1
82
+ signing_key:
83
+ specification_version: 2
84
+ summary: MingleMingle is a Mingle command line tool based on the Mingle REST api.
85
+ test_files: []
86
+