ruco 0.2.23 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d1f30802a00cd4515ab57e95417416dd32e0aa8
4
- data.tar.gz: 07e2e4b5891cdab09e0f503f7bbb37420fe24689
3
+ metadata.gz: b020114e69b37e9bc135f16e267ece5bc502fa32
4
+ data.tar.gz: 5dc7e130cbed60540752f03cff9c9d1515ec4a00
5
5
  SHA512:
6
- metadata.gz: 2f6d53b47b533e328bafc5c3a2fcd7791d28593182aa8571fc9f5d5e4ad56864c3a6b1e3b3f5d9043b9efc190ddd137540a0f882e9d2f14b78c6c7fe54a705e0
7
- data.tar.gz: 15b659678713c3c94c29b95650976e0efef15ea23775b8af418efe2fc7f5faf56e039f0aa5db7a2ff47c8e9c2f681b4beac2fe3f87f0107f298d7e245c811629
6
+ metadata.gz: ef8c19741fd5bc747cd09dc44c698f60cc0cf9b96e37f9c2338a9ba9921fe383c297d31ea4b4c469c9ac3d13ce530a4975ce92b7eeaa7d7aa02dcd15c75e4a94
7
+ data.tar.gz: bba1ab56310242d048792a9969fdc06167c2c3b3ea8393fe21308dd43a148e62d4a94015b05a1ca7f0e188cbe6c3e46266695588cd38cc444f3a4ef725939c25
data/bin/ruco CHANGED
@@ -1,37 +1,36 @@
1
1
  #!/usr/bin/env ruby
2
- # encoding: UTF-8
3
- require 'rubygems'
4
- gem 'clipboard'
5
2
  require 'curses'
6
3
  require 'optparse'
7
- $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
4
+
5
+ lib = File.expand_path("../../lib", __FILE__)
6
+ $LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib) # enable local development
8
7
 
9
8
  def parse_options
10
9
  options = {}
11
10
  parser = OptionParser.new do |opts|
12
- opts.banner = <<BANNER
13
- [Ru]by [Co]mmandline editor
11
+ opts.banner = <<-BANNER.gsub(/^ {6}/, "")
12
+ [Ru]by [Co]mmandline editor
14
13
 
15
- Shortcuts:
16
- Ctrl+w/q Exit
17
- Ctrl+s Save
14
+ Shortcuts:
15
+ Ctrl+w/q Exit
16
+ Ctrl+s Save
18
17
 
19
- Usage:
20
- ruco FILE
18
+ Usage:
19
+ ruco FILE
21
20
 
22
- Options:
23
- BANNER
21
+ Options:
22
+ BANNER
24
23
  opts.on("-c", "--convert-tabs","Convert tabs to spaces") { options[:convert_tabs] = true }
25
- opts.on("-u", "--undo-stack-size SIZE","Maximum size of the undo stack. 0 allows for a complete undo stack.") {|size| options[:undo_stack_size] = size.to_i }
24
+ opts.on("-u", "--undo-stack-size SIZE","Maximum size of the undo stack. 0 allows for a complete undo stack.") { |size| options[:undo_stack_size] = size.to_i }
26
25
  opts.on("-n", "--no-colors","No colors -- helps performance / broken terminals") { options[:no_colors] = true }
27
26
  opts.on("--colors","Force colors -- everything could be black") { options[:colors] = true }
28
27
  opts.on("--debug-cache","Show caching in action") { options[:debug_cache] = true }
29
28
  opts.on("--debug-keys", "Show pressed keys") { options[:debug_keys] = true }
30
- opts.on("-v", "--version","Show Version"){
29
+ opts.on("-v", "--version","Show Version") do
31
30
  require 'ruco/version'
32
31
  puts Ruco::VERSION
33
32
  exit
34
- }
33
+ end
35
34
  opts.on("-h", "--help","Show this.") { puts opts; exit }
36
35
  end
37
36
  parser.parse!
@@ -45,7 +44,7 @@ BANNER
45
44
  end
46
45
 
47
46
  def log(stuff)
48
- File.open('ruco.log','ab'){|f| f.puts stuff }
47
+ File.open('ruco.log','ab') { |f| f.puts stuff }
49
48
  end
50
49
 
51
50
  options = parse_options
@@ -82,7 +81,8 @@ require 'ruco'
82
81
  Dispel::Screen.open(options) do |screen|
83
82
  $ruco_screen = screen
84
83
 
85
- app = Ruco::Application.new(ARGV[0],
84
+ app = Ruco::Application.new(
85
+ ARGV[0],
86
86
  :convert_tabs => options[:convert_tabs],
87
87
  :undo_stack_size => options[:undo_stack_size],
88
88
  :lines => screen.lines, :columns => screen.columns
@@ -6,6 +6,7 @@ module Ruco
6
6
  @file, go_to_line = parse_file_and_line(file)
7
7
  @options = OptionAccessor.new(options)
8
8
 
9
+ change_terminal_title
9
10
  setup_actions
10
11
  setup_keys
11
12
  load_user_config
@@ -121,6 +122,14 @@ module Ruco
121
122
 
122
123
  private
123
124
 
125
+ # http://stackoverflow.com/questions/3232655
126
+ # terminal tab in iterm2 holds 23 characters by default
127
+ def change_terminal_title
128
+ print "\e[22;0;t"
129
+ print "\e]0;#{@file.ellipsize(max: 23)}\007;"
130
+ at_exit { print "\e[23;0;t" }
131
+ end
132
+
124
133
  def setup_actions
125
134
  @actions = {}
126
135
 
@@ -1,3 +1,3 @@
1
1
  module Ruco
2
- VERSION = Version = "0.2.23"
2
+ VERSION = Version = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.23
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-22 00:00:00.000000000 Z
11
+ date: 2015-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clipboard
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.9.8
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.9.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: textpow
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.3.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: language_sniffer
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: dispel
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.0.7
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.0.7
69
69
  description:
@@ -117,17 +117,17 @@ require_paths:
117
117
  - lib
118
118
  required_ruby_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - '>='
120
+ - - ">="
121
121
  - !ruby/object:Gem::Version
122
122
  version: 2.0.0
123
123
  required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - '>='
125
+ - - ">="
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.0.14
130
+ rubygems_version: 2.4.5.1
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Desktop-style, Intuitive, Commandline Editor in Ruby. 'Better than nano,