rubybuntu-gedit 11.08.19 → 11.08.20

Sign up to get free protection for your applications and to get access to all the features.
data/bin/rubybuntu-gedit CHANGED
@@ -2,8 +2,13 @@
2
2
  # The installer was done as fast as possible, so
3
3
  # TODO use dry and maintainable ruby code :D
4
4
 
5
+ # # #
5
6
  # enable colors if possible
6
- require 'paint' rescue nil
7
+ begin
8
+ require 'paint'
9
+ rescue LoadError
10
+ end
11
+
7
12
  unless defined? Paint
8
13
  module Paint
9
14
  def self.[](*args)
@@ -12,11 +17,31 @@ unless defined? Paint
12
17
  end
13
18
  end
14
19
 
20
+ # # #
21
+ # parse command line stuff
15
22
  if ARGV.shift != 'install'
16
23
  warn 'Currently, only "rubybuntu-gedit install" is supported. Quitting...'
17
24
  exit
18
25
  end
19
26
 
27
+ if ARGV.empty?
28
+ @todo = [:specs, :mime, :styles, :snippets]
29
+ else
30
+ @todo = []
31
+ case ARGV.shift
32
+ when /specs/
33
+ @todo << :specs
34
+ when /mime/
35
+ @todo << :mime
36
+ when /styles/
37
+ @todo << :styles
38
+ when /snippets/
39
+ @todo << :snippets
40
+ end
41
+ end
42
+
43
+ # # #
44
+ # helper methods
20
45
  def action(what)
21
46
  if what && !what.empty?
22
47
  puts Paint["x] #{what}", :yellow]
@@ -26,63 +51,89 @@ end
26
51
 
27
52
  def check_existence(what, sudo = true)
28
53
  if File.exists?(what)
29
- print ">> The installer found an outdated file at \"#{what}\"\n" \
30
- "Q] It's recommended to remove it. Do you want to remove it? [Yn]"
31
- action gets.chop =~ /^y?$/i ?
32
- "sudo rm -f #{what}"
33
- : nil
54
+ print "Q] The installer found an outdated file at \"#{what}\"\n" \
55
+ " It's recommended to remove it. Do you want to remove it? [Yn] "
56
+ action("sudo rm -f #{what}") if gets.chop =~ /^y?$/i
34
57
  end
35
58
  end
36
59
 
37
- @data = File.dirname(__FILE__) + "/../data"
38
-
39
- puts 'Welcome to the rubybuntu-gedit installer :D'
40
- puts 'Before each action I\'ll tell you what I am going to do'
41
- puts Paint['Please note: ', :bold] + 'I am pretty untested and might destroy your computer'
42
-
43
60
  # # #
44
61
  # language specs
45
- puts '>> Let\'s start with copying the language specs'
46
- print 'Q] Do you want to install the languages specs as sudo [/usr/share/gtksourceview-2.0/language-specs] or in your home directory [~/.local/share/gtksourceview-2.0/language-specs]? [Sh]'
47
- action gets.chop =~ /^s?$/i ?
48
- "sudo cp #@data/language-specs/*.lang /usr/share/gtksourceview-2.0/language-specs"
49
- : "mkdir -p ~/.local/share/gtksourceview-2.0/language-specs\n" \
50
- " cp #@data/language-specs/*.lang ~/.local/share/gtksourceview-2.0/language-specs"
51
-
52
- check_existence '/usr/share/gtksourceview-2.0/language-specs/rhtml.lang', true
53
- check_existence '/usr/share/gtksourceview-2.0/language-specs/ruby_on_rails.lang', true
54
- check_existence '~/.local/share/gtksourceview-2.0/language-specs/rhtml.lang', false
55
- check_existence '~/.local/share/gtksourceview-2.0/language-specs/ruby_on_rails.lang', false
62
+ def specs
63
+ puts Paint["\nLet's start with copying the language specs\n", :underline]
64
+ print "Q] Do you want to install the languages specs as sudo [/usr/share/gtksourceview-2.0/language-specs]\n" \
65
+ " or in your home directory [~/.local/share/gtksourceview-2.0/language-specs]? [Sh] "
66
+ if gets.chop =~ /^s?$/i
67
+ action "sudo cp #@data/language-specs/*.lang /usr/share/gtksourceview-2.0/language-specs"
68
+ else
69
+ action "mkdir -p ~/.local/share/gtksourceview-2.0/language-specs\n" \
70
+ " cp #@data/language-specs/*.lang ~/.local/share/gtksourceview-2.0/language-specs"
71
+ end
72
+
73
+ check_existence '/usr/share/gtksourceview-2.0/language-specs/rhtml.lang', true
74
+ check_existence '/usr/share/gtksourceview-2.0/language-specs/ruby_on_rails.lang', true
75
+ check_existence '~/.local/share/gtksourceview-2.0/language-specs/rhtml.lang', false
76
+ check_existence '~/.local/share/gtksourceview-2.0/language-specs/ruby_on_rails.lang', false
77
+ end
56
78
 
57
79
  # # #
58
80
  # mime
59
- puts '>> Now the mime types should be updated'
60
- print 'Q] Do you want to install the mime types as sudo [/usr/share/mime/packages] or in your home directory [~/.local/share/gtksourceview-2.0/language-specs]? [Sh]'
61
- action gets.chop =~ /^s?$/i ?
62
- "sudo cp #@data/mime/*.xml /usr/share/mime/packages\n" \
63
- " sudo update-mime-database /usr/share/mime"
64
- : "mkdir -p ~/.local/share/mime/packages\n" \
65
- " cp #@data/mime/*.xml ~/.local/share/mime/packages" \
66
- " update-mime-database ~/.local/share/mime"
67
-
68
- check_existence '/usr/share/mime/rails.xml', true
69
- check_existence '~/.local/share/mime/rails.xml', false
81
+ def mime
82
+ puts Paint["\nNow the mime types should be updated\n", :underline]
83
+ print "Q] Do you want to install the mime types as sudo [/usr/share/mime/packages]\n" \
84
+ " or in your home directory [~/.local/share/gtksourceview-2.0/language-specs]? [Sh] "
85
+ if gets.chop =~ /^s?$/i
86
+ action "sudo cp #@data/mime/*.xml /usr/share/mime/packages\n" \
87
+ " sudo update-mime-database /usr/share/mime"
88
+ else
89
+ action "mkdir -p ~/.local/share/mime/packages\n" \
90
+ " cp #@data/mime/*.xml ~/.local/share/mime/packages" \
91
+ " update-mime-database ~/.local/share/mime"
92
+ end
93
+
94
+ check_existence '/usr/share/mime/rails.xml', true
95
+ check_existence '~/.local/share/mime/rails.xml', false
96
+ end
70
97
 
71
98
  # # #
72
99
  # styles
73
- puts '>> Now, some styles get copied that use the new language specs :)'
74
- print 'Q] Do you want to install the styles as sudo [/usr/share/gtksourceview-2.0/styles] or in your home directory [~/.local/share/gtksourceview-2.0/styles]? [Sh]'
75
- action gets.chop =~ /^s?$/i ?
76
- "sudo cp #@data/styles/*.xml /usr/share/gtksourceview-2.0/styles"
77
- : "mkdir -p ~/.local/share/gtksourceview-2.0/styles\n" \
78
- " cp #@data/language-specs/*.lang ~/.local/share/gtksourceview-2.0/styles"
100
+ def styles
101
+ puts Paint["\nNow, some styles get copied that use the new language specs :)\n", :underline]
102
+ print "Q] Do you want to install the styles as sudo [/usr/share/gtksourceview-2.0/styles]\n" \
103
+ " or in your home directory [~/.local/share/gtksourceview-2.0/styles]? [Sh] "
104
+ if gets.chop =~ /^s?$/i
105
+ action "sudo cp #@data/styles/*.xml /usr/share/gtksourceview-2.0/styles"
106
+ else
107
+ action "mkdir -p ~/.local/share/gtksourceview-2.0/styles\n" \
108
+ " cp #@data/language-specs/*.lang ~/.local/share/gtksourceview-2.0/styles"
109
+ end
110
+ end
79
111
 
80
112
  # # #
81
113
  # snippets
82
- puts '>> Sorry, currently, the snippets cannot installed via this installer'
114
+ def snippets
115
+ puts Paint["\nSorry, currently, the snippets cannot installed via this installer\n", :underline]
116
+ puts "...\n"
117
+ end
118
+
83
119
 
120
+ # # #
121
+ # run
122
+ @data = File.dirname(__FILE__) + "/../data"
123
+
124
+ puts
125
+ puts Paint["Welcome to the rubybuntu-gedit installer :D", :green]
126
+ puts 'Before each action I\'ll tell you what I am going to do'
127
+ puts Paint['Please note: ', :bold] + 'I am pretty untested and might destroy your computer'
128
+
129
+ @todo.each{|todo| send todo }
130
+
131
+ puts
84
132
  puts Paint["Congratulations! You've updated your gedit stuff! (if everything worked correctly)", :green]
133
+ puts
85
134
  puts "If not, please install manually and open an issue on github"
86
135
  puts 'Don\'t forget to change your gedit style to "RubyBuntu One" ;)'
87
136
  puts
88
137
  puts " J-_-L"
138
+ puts
139
+
@@ -69,7 +69,7 @@
69
69
  <style name="def:string" foreground="#a0a0a0"/>
70
70
  <style name="ruby:string-delimiter" foreground="#9f7979"/>
71
71
  <style name="def:special-char" foreground="#dcdcdc"/>
72
- <style name="def:character" foreground="#a0a0a0"/><!-- question mark notation -->
72
+ <style name="def:character" use-style="def:string"/><!-- question mark notation -->
73
73
 
74
74
  <style name="ruby:system" foreground="#b5bb9d"/>
75
75
  <style name="ruby:system-delimiter" foreground="#929b6d"/>
@@ -82,7 +82,7 @@
82
82
 
83
83
  <style name="def:number" foreground="#6d9cbe"/>
84
84
  <style name="def:decimal" foreground="#6d9cbe" bold="true"/><!-- integer -->
85
- <style name="def:base-n-integer" foreground="#6d9cbe" italic="true"/>
85
+ <style name="def:base-n-integer" foreground="#6d9cbe" bold="true" italic="true"/>
86
86
 
87
87
  <style name="def:error" strikethrough="true"/>
88
88
 
@@ -99,7 +99,6 @@
99
99
  <style name="def:reserved" italic="true"/>
100
100
  <style name="def:statement" foreground="#aa7b55"/>
101
101
 
102
-
103
102
  <!-- other ruby stuff-->
104
103
  <style name="erb:tag" foreground="#ff592c"/>
105
104
  <style name="erb:output" foreground="#ff342c"/>
@@ -3,7 +3,7 @@ require 'rubygems' unless defined? Gem
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "rubybuntu-gedit"
6
- s.version = "11.08.19" #Time.now.strftime("%y.%m.%d")
6
+ s.version = '11.08.20'#Time.now.strftime("%y.%m.%d")
7
7
  s.authors = ["Jan Lelis", "Snippets by Christoph Olszowka", "Please see individual files for author and license"]
8
8
  s.email = "mail@janlelis.de"
9
9
  s.homepage = "https://github.com/janlelis/rubybuntu-gedit"
metadata CHANGED
@@ -1,37 +1,47 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rubybuntu-gedit
3
- version: !ruby/object:Gem::Version
4
- version: 11.08.19
3
+ version: !ruby/object:Gem::Version
4
+ hash: 79
5
5
  prerelease:
6
+ segments:
7
+ - 11
8
+ - 8
9
+ - 20
10
+ version: 11.08.20
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Jan Lelis
9
14
  - Snippets by Christoph Olszowka
10
15
  - Please see individual files for author and license
11
16
  autorequire:
12
17
  bindir: bin
13
18
  cert_chain: []
14
- date: 2011-08-18 00:00:00.000000000Z
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
19
+
20
+ date: 2011-08-19 00:00:00 Z
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
17
23
  name: paint
18
- requirement: &14780300 !ruby/object:Gem::Requirement
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
19
26
  none: false
20
- requirements:
21
- - - ! '>='
22
- - !ruby/object:Gem::Version
23
- version: '0'
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ hash: 3
31
+ segments:
32
+ - 0
33
+ version: "0"
24
34
  type: :runtime
25
- prerelease: false
26
- version_requirements: *14780300
27
- description: Ruby/Rails/Web related gedit language definitions, mime types, styles
28
- and snippets.
35
+ version_requirements: *id001
36
+ description: Ruby/Rails/Web related gedit language definitions, mime types, styles and snippets.
29
37
  email: mail@janlelis.de
30
- executables:
38
+ executables:
31
39
  - rubybuntu-gedit
32
40
  extensions: []
41
+
33
42
  extra_rdoc_files: []
34
- files:
43
+
44
+ files:
35
45
  - bin/rubybuntu-gedit
36
46
  - README.rdoc
37
47
  - data/language-specs/ruby-erb.lang
@@ -97,30 +107,50 @@ files:
97
107
  - Rakefile
98
108
  - rubybuntu-gedit.gemspec
99
109
  homepage: https://github.com/janlelis/rubybuntu-gedit
100
- licenses:
110
+ licenses:
101
111
  - GPL
102
- post_install_message: ! " ┌── info ─────────────────────────────────────┐\n
103
- J-_-L │ https://github.com/janlelis/rubybuntu-gedit │\n ├── usage ────────────────────────────────────┤\n
104
- \ │ rubybuntu-gedit install │\n └─────────────────────────────────────────────┘"
112
+ post_install_message: !binary |
113
+ ICAgICAgIOKUjOKUgOKUgCBpbmZvIOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKU
114
+ gOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKU
115
+ gOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKU
116
+ kAogSi1fLUwg4pSCIGh0dHBzOi8vZ2l0aHViLmNvbS9qYW5sZWxpcy9ydWJ5
117
+ YnVudHUtZ2VkaXQg4pSCCiAgICAgICDilJzilIDilIAgdXNhZ2Ug4pSA4pSA
118
+ 4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA
119
+ 4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA4pSA
120
+ 4pSA4pSA4pSA4pSA4pSkCiAgICAgICDilIIgcnVieWJ1bnR1LWdlZGl0IGlu
121
+ c3RhbGwgICAgICAgICAgICAgICAgICAgICDilIIKICAgICAgIOKUlOKUgOKU
122
+ gOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKU
123
+ gOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKU
124
+ gOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUgOKUmA==
125
+
105
126
  rdoc_options: []
106
- require_paths:
127
+
128
+ require_paths:
107
129
  - lib
108
- required_ruby_version: !ruby/object:Gem::Requirement
130
+ required_ruby_version: !ruby/object:Gem::Requirement
109
131
  none: false
110
- requirements:
111
- - - ! '>='
112
- - !ruby/object:Gem::Version
113
- version: '0'
114
- required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ hash: 3
136
+ segments:
137
+ - 0
138
+ version: "0"
139
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
140
  none: false
116
- requirements:
117
- - - ! '>='
118
- - !ruby/object:Gem::Version
119
- version: '0'
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ hash: 3
145
+ segments:
146
+ - 0
147
+ version: "0"
120
148
  requirements: []
149
+
121
150
  rubyforge_project:
122
- rubygems_version: 1.8.5
151
+ rubygems_version: 1.8.6
123
152
  signing_key:
124
153
  specification_version: 3
125
154
  summary: Ruby/Web devoloper's gedit
126
155
  test_files: []
156
+