sbag 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sbag/version.rb +1 -1
  3. data/lib/sbag.rb +59 -22
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f33d5071276f79feeb21cebcefe19eef42dce29
4
- data.tar.gz: 1584afdd8e8a499a6bfa15b0cb03d28d414fd5f4
3
+ metadata.gz: 1435cfd498935176f988eeb568a71907d67b8bb0
4
+ data.tar.gz: 53c3d0fb18b40094dd028da76990cbbed4cc060f
5
5
  SHA512:
6
- metadata.gz: 12bb7fc44453ac08669d21c40674691f32c24c016b3a0a64ddb3348889c5339bf0437fc78e460c94043e0fa0d65fbf78b35aedb6298bf294ccd8774d91d7f69d
7
- data.tar.gz: 212b9e838a3aedebd1253e23a9e51e048b6655dd0673703b5825712be07ca9246284f0a8eec197a70f348f4747f1c00ba2f1975500c1ee1e7e9b7d55ce7cfffa
6
+ metadata.gz: d63d4e9ccf13c5b126a9469f1b4835aaf2507695347e3c2dd7643c0b14a621590eb312334033a01451333f3ec8349b3d80b5b342cb3d69667caff3173788a669
7
+ data.tar.gz: 18053bb244a4d69ac5261a7993c0ad729ec6810aad3dbb87e56bd5536a292598b19943fa750251cb4dc5bb1f75113f527cc60863b0c37c2b94e60528f0d75c26
data/lib/sbag/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sbag
2
- VERSION = "0.1.6"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/sbag.rb CHANGED
@@ -4,32 +4,69 @@ require "colorize"
4
4
  module Sbag
5
5
 
6
6
  class C < Thor
7
+ #New File Command =====================================>>>
8
+ desc "newfile", "Create a new file"
9
+ method_option :newfile, :aliases => "-c" , :desc => "Use newfile command to create new file. Usage: [file_name].[file_extension]"
7
10
 
8
- #Create Command
9
- desc "create", "Create a new file"
10
- method_option :create, :aliases => "-c" , :desc => "Use create command to create new file. Usage: [file_name].[file_extension]"
11
-
12
- def create(file)
13
- new_file = File.new("#{file}","w+")
14
- puts "New file created => *#{file}*".green
15
- end
16
-
17
- #Delete Command
18
- desc "delete", "Delete the existing file"
19
- method_option :delete, :aliases => "-d", :desc => "Use create command to delete existing file. Usage: [file_name].[file_extension]"
11
+ def newfile(file)
12
+ new_file = File.new("#{file}","w+")
13
+ puts "New file created => *#{file}*".green
14
+ end
15
+ #========================END===============================#
16
+ #Delete File Command =====================================>>>
17
+ desc "delfile", "Delete the existing file"
18
+ method_option :delfile, :aliases => "-d", :desc => "Use delfile command to delete existing file. Usage: [file_name].[file_extension]"
20
19
 
21
- def delete(file)
22
- File.delete("#{file}")
23
- puts "Existing file deleted => *#{file}*".green
24
- end
25
-
26
- #Time Command
20
+ def delfile(file)
21
+ File.delete("#{file}")
22
+ puts "Existing file deleted => *#{file}*".green
23
+ end
24
+ #========================END===============================#
25
+ #Time Display Command =====================================>>>
27
26
  desc "time" , "Display current time"
28
27
  method_option :time, :aliases => "-t", :desc => "Use time command to display the current time"
29
28
 
30
- def time
31
- time = Time.now
32
- puts "Current time => *#{time}*".green
29
+ def time
30
+ time = Time.now
31
+ puts "Current time => *#{time}*".green
32
+ end
33
+ #========================END===============================#
34
+ #Current Location Command =====================================>>>
35
+ desc "locate", "Current directory or folder path"
36
+ method_option :locate, :aliases => "-loc", :desc => "Use locate command to find the current directory or folder path"
37
+
38
+ def locate
39
+ location = Dir.pwd
40
+ puts "Current Location => *#{location}*".green
41
+ end
42
+ #========================END===============================#
43
+ #Make new Directory Command =====================================>>>
44
+ desc "newdir", "Create a new directory or folder"
45
+ method_option :newdir, :aliases => "-nd", :desc => "Use newdir command to create a new directory or folder in the current path"
46
+
47
+ def newdir(new_dir)
48
+ Dir.mkdir("#{new_dir}")
49
+ location = Dir.pwd
50
+ puts "New Directory created => *#{new_dir}* at *#{location}*".green
51
+ end
52
+ #========================END===============================#
53
+ #Directory Listing Command =====================================>>>
54
+ desc "entries", "Files and directory Listing Command"
55
+ method_option :entries, :aliases => "-entries", :desc => "Use entries command to list all the files and directories in current path"
56
+
57
+ def entries
58
+ location = Dir.pwd
59
+ puts Dir.entries("#{location}").green
60
+ end
61
+ #========================END===============================#
62
+ #Delete Directory Command =====================================>>>
63
+ desc "deldir", "Delete directory or folder Command"
64
+ method_option :deldir, :aliases => "-ddir", :desc => "Use deldir command to delete the folder and directory in current path"
65
+
66
+ def deldir(del_dir)
67
+ Dir.delete("#{del_dir}")
68
+ puts "Deleted directory => *#{del_dir}*".green
69
+ end
70
+ #========================END===============================#
33
71
  end
34
72
  end
35
- end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shubham