flumtter 5.8.0 → 5.9.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7bccd88a92ccf666c865cf935c59081731b376b
|
4
|
+
data.tar.gz: e015b1507854aa262a43b4f2bf902cb27cf93799
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ca9c23c0845eeaded563f009ed8c3ad2bf04dbe2e37e21786d245c1e449f8bc1065075f37fec43fa6d3f5ed9e298357213131ddcd76e311837e6cb1ba0d2760
|
7
|
+
data.tar.gz: 0600975f192ced2aa1a81b927119ecb361b4dbb93e88780c3febda58c73c1668121b8c25e4f78111552a3002379b46a77975e1218666e2a168c758369d186cfb
|
@@ -25,7 +25,7 @@ module Initializer
|
|
25
25
|
opt.parse!(ARGV)
|
26
26
|
options.each{|k,v|@events[k].call(v,options) unless @events[k].nil?}
|
27
27
|
options
|
28
|
-
rescue OptionParser::InvalidOption => e
|
28
|
+
rescue OptionParser::InvalidOption, OptionParser::MissingArgument => e
|
29
29
|
STDERR.puts e.message
|
30
30
|
exit false
|
31
31
|
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
module Flumtter
|
2
|
+
plugin do
|
3
|
+
self::PluginDir = UserPath.join("plugins", "repo")
|
4
|
+
FileUtils.mkdir_p(self::PluginDir) unless FileTest.exist?(self::PluginDir)
|
5
|
+
self::Plugins = Dir.glob(File.join(self::PluginDir, "*/*/"))
|
6
|
+
File.join(self::PluginDir, "*/*/")
|
7
|
+
sarastire_user 'plugins/repo', '**/*.rb'
|
8
|
+
|
9
|
+
class self::Base < Window::Buf::Element
|
10
|
+
def self.parse_name(filename)
|
11
|
+
pname = Pathname(Plugins::PluginManager::PluginDir)
|
12
|
+
Pathname(filename).relative_path_from(pname).to_s
|
13
|
+
end
|
14
|
+
|
15
|
+
def element
|
16
|
+
@text ||= <<~EOF
|
17
|
+
#{@index}: #{name}
|
18
|
+
EOF
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
def name
|
23
|
+
self.class.parse_name(@object)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class self::Buf < Window::Buf::Buf
|
28
|
+
def initialize
|
29
|
+
super(Plugins::PluginManager::Base)
|
30
|
+
end
|
31
|
+
|
32
|
+
def prefetch
|
33
|
+
if @buf.empty?
|
34
|
+
adds(Plugins::PluginManager::Plugins)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
class self::PluginManager < Window::Buf::Screen
|
40
|
+
def initialize
|
41
|
+
super(Plugins::PluginManager::Buf.new, "PluginManager")
|
42
|
+
unless indexes.empty?
|
43
|
+
command(/^del\s+[#{indexes}]/, 'delete plugin(index)') do |m|
|
44
|
+
FileUtils.rm_r(Plugins::PluginManager::Plugins.delete_at(m[1].to_i))
|
45
|
+
Window.close
|
46
|
+
end
|
47
|
+
end
|
48
|
+
command(/^update/, 'update all plugins') do
|
49
|
+
Plugins::PluginManager::Plugins.each do |plugin|
|
50
|
+
`cd #{plugin}; git pull`; sleep 10
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
def indexes
|
57
|
+
Plugins::PluginManager::Plugins.size.times.to_a.join(",")
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
Keyboard.add(";", "Plugin Manager") do
|
62
|
+
self::PluginManager.new.show
|
63
|
+
end
|
64
|
+
|
65
|
+
add_opt do |opt, options|
|
66
|
+
opt.on('--add_plugin VALUES', "add new plugin") do |v|
|
67
|
+
if m = v.match(/[(:\/\/)@].+[:\/](.+)\/(.+?)(\.git)?$/)
|
68
|
+
`git clone #{v} #{File.join(self::PluginDir, m[1], m[2])}`
|
69
|
+
else
|
70
|
+
STDERR.puts "ERROR: invalid path".color
|
71
|
+
end
|
72
|
+
exit
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
add_opt do |opt, options|
|
77
|
+
opt.on('--plugins', 'show plugins') do
|
78
|
+
self::Plugins.each do |plugin|
|
79
|
+
puts self::Base.parse_name(plugin)
|
80
|
+
end
|
81
|
+
exit
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
data/lib/flumtter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flumtter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- flum1025
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -198,6 +198,7 @@ files:
|
|
198
198
|
- lib/flumtter/app/plugins/commands/user.rb
|
199
199
|
- lib/flumtter/app/plugins/commands/utility.rb
|
200
200
|
- lib/flumtter/app/plugins/load.rb
|
201
|
+
- lib/flumtter/app/plugins/plugin_manager.rb
|
201
202
|
- lib/flumtter/app/plugins/pry.rb
|
202
203
|
- lib/flumtter/app/plugins/timeline.rb
|
203
204
|
- lib/flumtter/app/plugins/timeline/base.rb
|