windclutter 0.0.11 → 0.0.12
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66125d708a4ca1e43afea540e13a828653bcde97b942a30a1ac667cda1b6908a
|
4
|
+
data.tar.gz: ce4fc5daebdb1be25c5c83f4ef9b9e703e1bdeac7abad63ee181085adbd44982
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6a1c42df834388a3be38ba709c72ec330ce005b9ce2213993a6a6639bc4642d98a2d74154dc49b9304ec35df40f624a2b65c09e570da1a6f2a2ef4f39ecdaba
|
7
|
+
data.tar.gz: 0cfc262377d0b96d3b96499c4718b36d745345218884e4b6aea79e2e32952d57c05aceead4333d419edb8c57b67672defe6604e0e9e7df1e5ade7505aa798f5f
|
@@ -8,20 +8,6 @@ module WindClutter
|
|
8
8
|
module CLI
|
9
9
|
module Commands
|
10
10
|
module Project
|
11
|
-
# Initiate setup for specified project
|
12
|
-
class Init < Dry::CLI::Command
|
13
|
-
include WindClutter::Util
|
14
|
-
|
15
|
-
desc 'Setup windclutter for your project'
|
16
|
-
|
17
|
-
argument :name, required: true, desc: 'Name of your project.'
|
18
|
-
|
19
|
-
def call(name:, **)
|
20
|
-
FileHandler.create_project(name)
|
21
|
-
puts 'Successfully created!'.green
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
11
|
# List all of created project for windclutter
|
26
12
|
class List < Dry::CLI::Command
|
27
13
|
include WindClutter::Util
|
@@ -39,19 +25,20 @@ module WindClutter
|
|
39
25
|
|
40
26
|
desc 'Use the project, automatically create one if not exists yet.'
|
41
27
|
|
42
|
-
argument :name,
|
28
|
+
argument :name, desc: 'Name of your project.'
|
43
29
|
|
44
|
-
def call(name
|
45
|
-
|
30
|
+
def call(name: nil, **)
|
31
|
+
project_name = name || File.basename(Dir.pwd)
|
46
32
|
|
47
|
-
unless
|
48
|
-
|
49
|
-
|
33
|
+
FileHandler.init_config unless Config.exists?
|
34
|
+
unless FileHandler.list_projects.include? project_name
|
35
|
+
FileHandler.create_project(project_name)
|
36
|
+
puts 'No project, we created one instead'.yellow
|
50
37
|
end
|
51
38
|
|
52
|
-
Config.update('active_project',
|
53
|
-
Config.setup_project(
|
54
|
-
puts "Using project \"#{
|
39
|
+
Config.update('active_project', project_name)
|
40
|
+
Config.setup_project(project_name)
|
41
|
+
puts "Using project \"#{project_name}\"".green
|
55
42
|
end
|
56
43
|
end
|
57
44
|
|
data/lib/windclutter/cli/core.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'awesome_print'
|
3
4
|
require 'dry/cli'
|
4
5
|
require 'windclutter/version'
|
5
6
|
require 'windclutter/util/file_handler'
|
@@ -22,17 +23,6 @@ module WindClutter
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
|
-
# Perform initial setup for windclutter
|
26
|
-
class Install < Dry::CLI::Command
|
27
|
-
include WindClutter::Util
|
28
|
-
|
29
|
-
desc 'Initiate first setup for windclutter'
|
30
|
-
|
31
|
-
def call(*)
|
32
|
-
FileHandler.init_config
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
26
|
# Uninstallation handler
|
37
27
|
class Uninstall < Dry::CLI::Command
|
38
28
|
include WindClutter::Util
|
@@ -51,19 +41,17 @@ module WindClutter
|
|
51
41
|
desc 'Debug the configuration of windclutter'
|
52
42
|
|
53
43
|
def call(*)
|
54
|
-
|
44
|
+
ap Config.wtf?
|
55
45
|
end
|
56
46
|
end
|
57
47
|
|
58
48
|
register 'version', ShowVersion, aliases: %w[v -v --version]
|
59
|
-
register '
|
49
|
+
register 'use', Commands::Project::Use, aliases: %w[u -u --use]
|
60
50
|
register 'uninstall', Uninstall, aliases: %w[u -u --uninstall]
|
61
51
|
register 'debug', Debug, aliases: %w[d -d --debug]
|
62
52
|
|
63
53
|
register 'project', aliases: ['p'] do |prefix|
|
64
|
-
prefix.register 'init', Commands::Project::Init
|
65
54
|
prefix.register 'list', Commands::Project::List
|
66
|
-
prefix.register 'use', Commands::Project::Use
|
67
55
|
prefix.register 'current', Commands::Project::Current
|
68
56
|
prefix.register 'dump-path', Commands::Project::DumpPath, aliases: ['-d']
|
69
57
|
prefix.register 'config', Commands::Project::ConfigUpdate, aliases: ['-c']
|
@@ -69,13 +69,7 @@ module WindClutter
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def self.exists?
|
72
|
-
|
73
|
-
puts 'You have not install windclutter yet'.yellow
|
74
|
-
puts 'To install, run:'
|
75
|
-
puts "\twindclutter install".green
|
76
|
-
return false
|
77
|
-
end
|
78
|
-
true
|
72
|
+
File.file?('/tmp/windclutter/config.yml')
|
79
73
|
end
|
80
74
|
end
|
81
75
|
end
|
@@ -15,6 +15,7 @@ module WindClutter
|
|
15
15
|
|
16
16
|
template = File.expand_path('../../template', File.dirname(__FILE__))
|
17
17
|
|
18
|
+
puts 'First setup of windclutter...'.green
|
18
19
|
puts 'Created the following files:'
|
19
20
|
Dir["#{template}/*.yml"].each do |file|
|
20
21
|
FileUtils.cp(file, '/tmp/windclutter')
|
data/lib/windclutter/version.rb
CHANGED