flumtter 5.8.0 → 5.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 055d05556319ce9b251e277a8da83930aa0bc833
4
- data.tar.gz: 57e0bc27ef7fc86e86a6ae3a99f39b05ee15e3e6
3
+ metadata.gz: e7bccd88a92ccf666c865cf935c59081731b376b
4
+ data.tar.gz: e015b1507854aa262a43b4f2bf902cb27cf93799
5
5
  SHA512:
6
- metadata.gz: e0a49e4bd768a75fa868fd9d48b3fcf5ec9b7054b25e879bd0a69d0fc4b56b1c5c509c088094d3db5dae01affd346cf6985b7b51793d0bdfd80b7f6599190465
7
- data.tar.gz: 11d4a67ba8256cb2a8d3d1db9a24dacb653dbfeacf21830b0de3520e4cee8b3fe552e3ea94b7fbc82bfe3f4b5c87dfe8c6a082d637170350af05eafe37b33a50
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
@@ -106,6 +106,10 @@ module Flumtter
106
106
  Flumtter.sarastire(*args)
107
107
  end
108
108
 
109
+ def sarastire_user(*args)
110
+ Flumtter.sarastire_user(*args)
111
+ end
112
+
109
113
  def on_event(*args,&blk)
110
114
  Flumtter.on_event(*args,&blk)
111
115
  end
@@ -12,5 +12,9 @@ module Flumtter
12
12
  @width = [width,title.title.exact_size+2].max
13
13
  end
14
14
  end
15
+
16
+ def self.close
17
+ raise Dispel::CloseWindow
18
+ end
15
19
  end
16
20
  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
@@ -1,3 +1,3 @@
1
1
  module Flumtter
2
- VERSION = "5.8.0"
2
+ VERSION = "5.9.0"
3
3
  end
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.8.0
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-24 00:00:00.000000000 Z
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