jota 0.8.1 → 0.9.0dev2

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/lib/version.rb CHANGED
@@ -1,20 +1,41 @@
1
1
 
2
- # $Id: version.rb 40 2009-03-14 10:19:43Z dz $
2
+ # $Id: version.rb 270 2010-06-02 16:00:02Z dz $
3
3
 
4
- require "svn_info"
5
4
 
6
5
  class Version
7
6
 
8
- include SVN_Info
7
+ def Version.state
8
+ result = ""
9
+ if STATE != "" then
10
+ result = "#{STATE}"
11
+ if STATEVER > 0 then
12
+ result += ("%d" % STATEVER)
13
+ end
14
+ end
15
+ return result
16
+ end
17
+
18
+ def Version.ruby_version
19
+ return "Ruby #{RUBY_VERSION}"
20
+ end
21
+
22
+ def Version.platform
23
+ return "#{RUBY_PLATFORM}"
24
+ end
25
+
26
+ # Semantic versioning used. See http://semver.org for details
9
27
 
10
28
  MAJOR = 0
11
- MINOR = 8
12
- REVISION = 1
29
+ MINOR = 9
30
+ PATCH = 0
31
+ STATE = "dev" # "dev", "beta", "rc", "" (for final)
32
+ STATEVER = 2
13
33
 
14
- STRING = "%d.%d.%d" % [MAJOR, MINOR,REVISION]
34
+ STRING = "%d.%d.%d%s" % [MAJOR, MINOR,PATCH,Version.state]
15
35
 
16
- PROGRAM_NAME = "jota"
17
- YEARS = "2008-2009"
36
+ PROGRAM_NAME = "Jota"
37
+ PROGRAM_NAMELC = PROGRAM_NAME.downcase
38
+ YEARS = "2008-2010"
18
39
 
19
40
  AUTHOR = "Derik van Zuetphen"
20
41
  AUTHOR_EMAIL = "dz@426.ch"
@@ -48,12 +69,4 @@ LICENSE = "
48
69
  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49
70
  "
50
71
 
51
- def Version.build
52
- date,time = SVN_LAST_CHANGED_DATE.split(/ /)
53
- date.gsub!(/[^0-9]/,"")
54
- time.gsub!(/[^0-9]/,"")
55
- rev = SVN_REVISION
56
- return "#{rev}/#{date}T#{time}"
57
- end
58
-
59
72
  end # class
data/tests/test_all.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # $Id: test_all.rb 28 2009-01-22 09:20:48Z dz $
3
+ # $Id: test_all.rb 68 2010-01-04 14:23:45Z dz $
4
4
 
5
5
  # http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html
6
6
 
data/tests/test_clip.rb CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # $Id: test_clip.rb 28 2009-01-22 09:20:48Z dz $
2
+ # $Id: test_clip.rb 68 2010-01-04 14:23:45Z dz $
3
3
 
4
4
  require 'test/unit'
5
5
  require 'clip'
@@ -1,5 +1,5 @@
1
1
 
2
- # $Id: test_clip_array.rb 28 2009-01-22 09:20:48Z dz $
2
+ # $Id: test_clip_array.rb 68 2010-01-04 14:23:45Z dz $
3
3
 
4
4
  require 'test/unit'
5
5
 
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jota
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ hash: 470221478
5
+ prerelease: true
6
+ segments:
7
+ - 0
8
+ - 9
9
+ - 0dev2
10
+ version: 0.9.0dev2
5
11
  platform: ruby
6
12
  authors:
7
13
  - Derik van Zuetphen
@@ -9,73 +15,77 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2009-10-11 16:38:01 +02:00
18
+ date: 2010-07-30 11:28:16 +02:00
13
19
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: cmd
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 0.7.2
24
- version:
20
+ dependencies: []
21
+
25
22
  description: ""
26
23
  email: dz@426.ch
27
24
  executables:
28
25
  - jota
29
- - jotacli
30
26
  extensions: []
31
27
 
32
28
  extra_rdoc_files:
33
29
  - INSTALL
30
+ - LICENSE
34
31
  files:
35
32
  - lib/app_error.rb
36
33
  - lib/clip_array.rb
37
34
  - lib/clip.rb
38
35
  - lib/gui.rb
39
36
  - lib/helper.rb
37
+ - lib/jota_curses.rb
40
38
  - lib/jota.rb
41
39
  - lib/preferences.rb
42
40
  - lib/version.rb
43
- - lib/cli.rb
44
- - lib/svn_info.rb
41
+ - lib/immediate.rb
45
42
  - lib/jota.glade
46
- - tests/test_all.rb
47
- - tests/test_clip.rb
43
+ - bin/jota
44
+ - bin/jota.bat
48
45
  - tests/test_clip_array.rb
46
+ - tests/test_clip.rb
47
+ - tests/test_all.rb
49
48
  - tests/test_preferences.rb
50
49
  - INSTALL
50
+ - LICENSE
51
51
  has_rdoc: true
52
52
  homepage: http://426.ch/jota
53
+ licenses: []
54
+
53
55
  post_install_message:
54
56
  rdoc_options: []
55
57
 
56
58
  require_paths:
57
59
  - lib
58
60
  required_ruby_version: !ruby/object:Gem::Requirement
61
+ none: false
59
62
  requirements:
60
63
  - - ">="
61
64
  - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
62
68
  version: "0"
63
- version:
64
69
  required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
65
71
  requirements:
66
- - - ">="
72
+ - - ">"
67
73
  - !ruby/object:Gem::Version
68
- version: "0"
69
- version:
74
+ hash: 25
75
+ segments:
76
+ - 1
77
+ - 3
78
+ - 1
79
+ version: 1.3.1
70
80
  requirements: []
71
81
 
72
82
  rubyforge_project: jota
73
- rubygems_version: 1.3.1
83
+ rubygems_version: 1.3.7
74
84
  signing_key:
75
- specification_version: 2
85
+ specification_version: 3
76
86
  summary: A simple but powerful jotter in the style of xclipboard
77
87
  test_files:
78
- - tests/test_all.rb
79
- - tests/test_clip.rb
80
88
  - tests/test_clip_array.rb
89
+ - tests/test_clip.rb
90
+ - tests/test_all.rb
81
91
  - tests/test_preferences.rb
data/bin/jotacli DELETED
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # $Id: jotacli 28 2009-01-22 09:20:48Z dz $
4
-
5
- begin
6
- require 'jota'
7
- rescue LoadError
8
- require 'rubygems'
9
- require 'jota'
10
- end
11
-
12
- Jota.new.run_cli
data/lib/cli.rb DELETED
@@ -1,250 +0,0 @@
1
-
2
- # $Id: cli.rb 46 2009-05-08 09:27:55Z dz $
3
-
4
- # if you use vim and don't like folds type zR
5
-
6
- require 'clip'
7
- require 'clip_array'
8
- require 'preferences'
9
-
10
- begin
11
- require 'cmd'
12
- rescue LoadError
13
- require 'rubygems'
14
- require 'cmd'
15
- end
16
-
17
- class JotaCli < Cmd
18
-
19
- require 'tempfile'
20
- prompt_with :prompt_command
21
-
22
- doc :open, "Open clip file"
23
- doc :close, "Close clip file"
24
- doc :create, "Create a new empty clip file"
25
- doc :list, "List clips with type, index number and title"
26
- doc :edit, "Edit clip with $EDITOR (or /usr/bin/vi if not set)"
27
- doc :show, "Show contents of clip"
28
- doc :new, "Create a new clip"
29
- doc :delete, "Delete a clip"
30
- doc :default, "Set default command"
31
- doc :page, "Show content of clip through $PAGER"
32
-
33
-
34
- def do_open(args)
35
- #{{{1
36
- filename = args.to_s
37
- @data.close if @data
38
- begin
39
- @data = ClipArray.open(filename)
40
- rescue SystemCallError, AppError => msg
41
- puts msg
42
- @data = nil
43
- end
44
- end #}}}1
45
-
46
- def do_close
47
- #{{{1
48
- return if @data.nil?
49
-
50
- @data.close
51
- @data = nil
52
- end #}}}1
53
-
54
- def do_create(args)
55
- #{{{1
56
- filename = args.to_s
57
- @data.close if @data
58
- begin
59
- @data = ClipArray.create(filename)
60
- rescue SystemCallError, AppError => msg
61
- puts msg
62
- @data = nil
63
- end
64
- end #}}}1
65
-
66
- def do_list
67
- #{{{1
68
- return if @data.nil?
69
-
70
- @data.each_index do | i |
71
- print "%2d %s %s\n" % [
72
- i+1,
73
- type_to_char(@data[i].type),
74
- @data[i].title]
75
- end
76
- end #}}}1
77
-
78
- def do_edit(args)
79
- #{{{1
80
- index = get_index(args)
81
- return if index.nil?
82
-
83
- @data[index].text = editor(@data[index].text)
84
-
85
- # because of this save we do not not need autosave for the cli version
86
- @data.save
87
- end #}}}1
88
-
89
- def do_show(args)
90
- #{{{1
91
- index = get_index(args)
92
- return if index.nil?
93
-
94
- puts @data[index].title
95
- puts @data[index].data
96
- end #}}}1
97
-
98
- def do_delete(args)
99
- #{{{1
100
- index = get_index(args)
101
- return if index.nil?
102
-
103
- @data.current_index = index
104
-
105
- if pref("deletesave_enable") and not @data.current.empty? then
106
- deletefile = expand_filename(pref("deletesave_file"),
107
- @data.dirname, @data.filename)
108
- begin
109
- @data.current.append_as_mbox(deletefile)
110
- rescue SystemCallError => msg
111
- puts msg
112
- end
113
- end
114
-
115
- @data.delete
116
- end #}}}1
117
-
118
- def do_new
119
- #{{{1
120
- return if @data.nil?
121
-
122
- @data.new
123
- end #}}}1
124
-
125
- def do_page(args)
126
- #{{{1
127
- index = get_index(args)
128
- return if index.nil?
129
-
130
- file = Tempfile.new("jotacli")
131
- filename = file.path
132
- print_verbose "creating temporary file '#{filename}'"
133
-
134
- file.puts @data[index].title
135
- file.puts @data[index].data
136
- file.close
137
-
138
- if ENV["PAGER"] then
139
- cmdline = ENV["PAGER"]
140
- else
141
- cmdline = "/bin/more"
142
- end
143
- cmdline = "%s %s" % [cmdline, filename]
144
- print_verbose "executing '#{cmdline}'"
145
-
146
- if not system(cmdline) then
147
- puts "Error executing '#{cmdline}' with exit code #{$?}"
148
- end
149
-
150
- File.unlink(filename)
151
- end #}}}1
152
-
153
- def do_default(args)
154
- #{{{1
155
- if args.nil? or args == "" then
156
- puts "Default command is '#{@default_command}'"
157
- elsif args =~ /^(show|edit|page)$/ then
158
- @default_command = args
159
- else
160
- puts "Illegal default command. Valid are show, edit, and page"
161
- end
162
- end #}}}1
163
-
164
- private
165
-
166
- def setup
167
- #{{{1
168
- puts "#{Version::PROGRAM_NAME} #{Version::STRING} ready"
169
- puts "Type 'help' for commands"
170
-
171
- @data = nil
172
- @default_command = "edit"
173
- end #}}}1
174
-
175
- def command_missing(command, args)
176
- #{{{1
177
- case @default_command
178
- when "show"
179
- do_show(command)
180
- when "edit"
181
- do_edit(command)
182
- when "page"
183
- do_page(command)
184
- end
185
- end #}}}1
186
-
187
- def prompt_command
188
- #{{{1
189
- if @data.nil? then
190
- "> "
191
- else
192
- @data.filename+"> "
193
- end
194
- end #}}}1
195
-
196
- def postloop
197
- #{{{1
198
- @data.save if @data
199
- end #}}}1
200
-
201
- def type_to_char(t)
202
- #{{{1
203
- case t
204
- when :text
205
- return "t"
206
- when :pref
207
- return "p"
208
- else
209
- return "?"
210
- end
211
- end #}}}1
212
-
213
- def get_index(str)
214
- #{{{1
215
- return nil if @data.nil? or str.nil?
216
-
217
- if str =~ /^\d+$/ then
218
- result = str.to_i - 1
219
- else
220
- result = nil
221
- re = Regexp.new(str,Regexp::IGNORECASE)
222
- @data.each_index do | i |
223
- if @data[i].title.match(re) then
224
- result = i
225
- break
226
- end
227
- end
228
- if result.nil? then
229
- return nil
230
- end
231
- end
232
- if result < 0 or result >= @data.length then
233
- return nil
234
- else
235
- return result
236
- end
237
- end #}}}1
238
-
239
- def pref(key)
240
- #{{{1
241
- if @data.nil? then
242
- return Preferences.defaults[key]
243
- else
244
- @data.pref[key]
245
- end
246
- end #}}}1
247
-
248
- end # class
249
-
250
- # vim: set foldmethod=marker:
data/lib/svn_info.rb DELETED
@@ -1,16 +0,0 @@
1
- # This file is created by './make_svn_info.rb'
2
-
3
- module SVN_Info
4
-
5
- SVN_PATH="."
6
- SVN_URL="svn+ssh://solaria.426.ch/svn/jota/trunk"
7
- SVN_REPOSITORY_ROOT="svn+ssh://solaria.426.ch/svn"
8
- SVN_REPOSITORY_UUID="ff64bd42-7924-4c15-ba74-d98c4559417c"
9
- SVN_REVISION="55"
10
- SVN_NODE_KIND="directory"
11
- SVN_SCHEDULE="normal"
12
- SVN_LAST_CHANGED_AUTHOR="dz"
13
- SVN_LAST_CHANGED_REV="55"
14
- SVN_LAST_CHANGED_DATE="2009-10-11 15:02:40 +0200 (Sun, 11 Oct 2009)"
15
-
16
- end