Titania 0.0.6 → 0.0.7

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: e1d1eedfd26394d190ab2561b1113e4efd1317fa
4
- data.tar.gz: 931956f6a8662faee887cba4e5f938270fb7e9b0
3
+ metadata.gz: 67fdba9a45737843a03420bc799e23764d8868d3
4
+ data.tar.gz: e3ebde3d8fea78c717d6b24b1274a7cfc406d08d
5
5
  SHA512:
6
- metadata.gz: 155e0a94dcf248aadc2bc9e06e0e65c0775b437b562824b6558e9660500645a1751c3bf659e0d80d5da9a144e3a696d5bd770c0dae6570a837c827e92f338e2f
7
- data.tar.gz: c71c853004f9edc13c30ef90ff9c02f2d037d580968d1cd99020209d9771fd531200d5ebb5594d9d8668d1b261e42ee29aad281b070fc42e04aeda3389f90db9
6
+ metadata.gz: ba089c66ab14411d87419065652f2c024c60cae09f7842507f47c916e6fc7858c6bd2510e55dbb5c315bcd66c10b03aae388c50c589701c53d927c3b151d7a0c
7
+ data.tar.gz: 422a79bfb443e76cef5a4b1b8fa6f52caa10151ac61ee9f835bb1fc92ce4f080041efbcccea357bec80cd84e2911ec80f9c64dac865382353a4679fd832fdc4e
@@ -10,8 +10,9 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["iamcodegrab@gmail.com"]
11
11
  spec.description = %q{FTP Connection & Management Gem}
12
12
  spec.summary = %q{Ruby FTP Connection & Management Gem}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/sedatciftci/Titania"
14
14
  spec.license = "MIT"
15
+ spec.rdoc_options << '--main' << 'README'
15
16
 
16
17
  spec.files = `git ls-files`.split($/)
17
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
@@ -1,4 +1,97 @@
1
1
  require "net/ftp"
2
2
  require "Titania/version"
3
- require "Titania/ftp"
3
+
4
+
5
+ module Titania
6
+ class Connection
7
+ attr_accessor :connect
8
+
9
+ @@host
10
+ @@username
11
+ @@password
12
+
13
+ def initialize(host,username,password)
14
+ @@host = host
15
+ @@username = username
16
+ @@password = password
17
+ end
18
+
19
+ def connect
20
+ con = self.connect = Net::FTP::new(@@host, @@username, @@password)
21
+ end
22
+
23
+ def get_list(path = '/')
24
+
25
+ # File List / Return Array
26
+
27
+ result = self.connect.list(path)
28
+ end
29
+
30
+ def current_dir
31
+ # get current dir
32
+ self.connect.pwd
33
+ end
34
+
35
+ def change_dir(path)
36
+ # Change dir
37
+ self.connect.chdir(path)
38
+ end
39
+
40
+
41
+ def delete_file(path, file_name)
42
+ # Delete file
43
+ self.connect.delete(path + "/" + file_name)
44
+ end
45
+
46
+
47
+ def create_dir(path, dir_name)
48
+ # Create dir
49
+
50
+ self.connect.mkdir(path + "/" + dir_name)
51
+ end
52
+
53
+
54
+ def help(argv = nil)
55
+ # Help
56
+ cmd = "HELP"
57
+ if argv
58
+ cmd = cmd + " " + argv
59
+ end
60
+
61
+ self.connect.sendcmd(cmd)
62
+
63
+ end
64
+
65
+ def change_name(f_name, c_name)
66
+ # Change file or directory name
67
+ self.connect.rename(f_name, c_name)
68
+ end
69
+
70
+ def remove_dir(dir)
71
+ # Remove dir
72
+ self.connect.rmdir(dir)
73
+ end
74
+
75
+ def file_size(file)
76
+ # Get File Size
77
+ self.connect.size(file)
78
+ end
79
+
80
+ def connection_status
81
+ # Connection status
82
+ if self.connect.closed?
83
+ puts "Connection is closed !"
84
+ else
85
+ puts "Connection is active !"
86
+ end
87
+ end
88
+
89
+ def close
90
+ # close connection
91
+ self.connect.close
92
+ end
93
+
94
+ end
95
+
96
+ end
4
97
 
@@ -1,3 +1,3 @@
1
1
  module Titania
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Titania
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sedat Ciftci
@@ -53,12 +53,14 @@ files:
53
53
  - Titania.gemspec
54
54
  - lib/Titania.rb
55
55
  - lib/Titania/version.rb
56
- homepage: ''
56
+ homepage: https://github.com/sedatciftci/Titania
57
57
  licenses:
58
58
  - MIT
59
59
  metadata: {}
60
60
  post_install_message:
61
- rdoc_options: []
61
+ rdoc_options:
62
+ - --main
63
+ - README
62
64
  require_paths:
63
65
  - lib
64
66
  required_ruby_version: !ruby/object:Gem::Requirement