temptofile 1.0.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 +7 -0
- checksums.yaml.gz.sig +0 -0
- data/README.md +21 -0
- data/lib/temptofile.rb +20 -0
- data/temptofile.gemspec +22 -0
- data.tar.gz.sig +0 -0
- metadata +73 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a7e2f5c5c8ba59192209e56b1c173e1510141dbe
|
4
|
+
data.tar.gz: 178754fe84d9e9d9f2bdf3913b436f7099a8130b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b2a4b1eac98f6b1b52682202b05558d34affadeee06d33bc8bcb8941ffa0626c29fb5a0676c5495b4a1dd177d08bfa4615faab8b6bf3d565b1abb230d0dd7fbe
|
7
|
+
data.tar.gz: 0204886cc079e41066fca45a1bb3645507089e1c3c784fb84c654af4538d90023c83cf28fe9cc18c155009577ea56626a636302c4419f7eef61483340df0383d
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data/README.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# TempToFile
|
2
|
+
|
3
|
+
[](http://badge.fury.io/rb/temptofile)
|
4
|
+
|
5
|
+
This is a simple gem to save your Tempfile to File. It works by :
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
require 'temptofile'
|
9
|
+
Tempfile.new('text.txt').save!
|
10
|
+
```
|
11
|
+
|
12
|
+
# Installation
|
13
|
+
Use rubygems :
|
14
|
+
``gem install temptofile``
|
15
|
+
|
16
|
+
# Parameters
|
17
|
+
|
18
|
+
You can also add few parameters to save! :
|
19
|
+
* ``{name: 'savetxt'}`` : the file will be save as 'savetxt'
|
20
|
+
* ``{prefix: '_save'}`` : the file will be save as 'text.txt_save' (default)
|
21
|
+
* ``{suffix: 'save_'}`` : the file will be save as 'save_text.txt'
|
data/lib/temptofile.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module TempToFile
|
2
|
+
VERSION = '1.0.0'
|
3
|
+
end
|
4
|
+
|
5
|
+
class Tempfile
|
6
|
+
def save!(options={suffix: '_save'})
|
7
|
+
if not options[:name].nil?
|
8
|
+
File.rename(self.to_path, options[:name]) rescue return nil
|
9
|
+
return options[:name]
|
10
|
+
elsif not options[:suffix].nil?
|
11
|
+
File.rename(self.to_path, self.to_path + options[:suffix]) rescue return nil
|
12
|
+
return self.to_path + options[:suffix]
|
13
|
+
elsif not options[:prefix].nil?
|
14
|
+
File.rename(self.to_path, options[:suffix] + self.to_path) rescue return nil
|
15
|
+
return options[:suffix] + self.to_path
|
16
|
+
else
|
17
|
+
return nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/temptofile.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require_relative "lib/temptofile"
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = 'temptofile'
|
5
|
+
s.version = TempToFile::VERSION
|
6
|
+
s.date = Time.now.getgm.to_s.split.first
|
7
|
+
s.summary = "..."
|
8
|
+
s.description = "Tempfile to File"
|
9
|
+
s.authors = [
|
10
|
+
"poulet_a"
|
11
|
+
]
|
12
|
+
s.email = "poulet_a@epitech.eu",
|
13
|
+
s.files = [
|
14
|
+
"lib/temptofile.rb",
|
15
|
+
"README.md",
|
16
|
+
"temptofile.gemspec",
|
17
|
+
]
|
18
|
+
s.homepage = "https://gitlab.com/poulet_a/temptofile"
|
19
|
+
s.license = "GNU/GPLv3"
|
20
|
+
s.cert_chain = ['certs/poulet_a.pem']
|
21
|
+
s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
|
22
|
+
end
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: temptofile
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- poulet_a
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRYwFAYDVQQDDA1hcnRo
|
14
|
+
dXIucG91bGV0MRkwFwYKCZImiZPyLGQBGRYJY3J5cHRvbGFiMRMwEQYKCZImiZPy
|
15
|
+
LGQBGRYDbmV0MB4XDTE0MDkwNDE1MDkyMFoXDTE1MDkwNDE1MDkyMFowSDEWMBQG
|
16
|
+
A1UEAwwNYXJ0aHVyLnBvdWxldDEZMBcGCgmSJomT8ixkARkWCWNyeXB0b2xhYjET
|
17
|
+
MBEGCgmSJomT8ixkARkWA25ldDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
+
ggEBAMDqhyu/5qz2t9kfQ4CIt3J3MEh2sIwyzYQQ12MUZTTEolRt2WR/qenp1A5M
|
19
|
+
Dubc+bIiCp79HuJ5MM5A+4PHtD+/bqq1LusBgopaM2l5DBlHHDlqddEuLApr16zM
|
20
|
+
cnBPadC2EYvyjWOPVoDDNSq5eRriVRKomk08lSnL26T/gOQUGcOZjALpQYSor5ac
|
21
|
+
vw8kfLy1eEt2/WGUUSCMePpdrmOwIxnIhE4rFqFIIQAeQPlSrrcfPGhwOGQrpEwp
|
22
|
+
aboHkSLKmIU0SK5xcmye2qr0UuuSRaQ1PAv3hluBd3aUBmc2Cwv6S3HhklhljE10
|
23
|
+
QhxZbfhDf8nJP9pu6LT3YIOTTF0CAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
|
24
|
+
DwQEAwIEsDAdBgNVHQ4EFgQUFnnzgNhSvyp3vxi4lYpqsBLUeDcwJgYDVR0RBB8w
|
25
|
+
HYEbYXJ0aHVyLnBvdWxldEBjcnlwdG9sYWIubmV0MCYGA1UdEgQfMB2BG2FydGh1
|
26
|
+
ci5wb3VsZXRAY3J5cHRvbGFiLm5ldDANBgkqhkiG9w0BAQUFAAOCAQEAAZAyRQD2
|
27
|
+
sIRFQzt+hievj7X9oP6xD/Hb0/PZJyLe/D0UOiYfI7okQsFc84vmSsDd1Nh32AwZ
|
28
|
+
stlvzVD284pcwf9T9FYQ+oOfO8KUVZ5ARfmz2If4ddvaNpV9gDRrbR1gtLv3c9/l
|
29
|
+
yLInq7jG1BcNKPtA3/3fsT+hw0PJmgE7bUGOCCggWnvalGdQq1quUSJb6VgY3inJ
|
30
|
+
RNnQfSr2kwW1eMwy22OQdbLMvLxHzmQs2llPzxG5zCFjdk3ipYr59JDvi6yK0MFb
|
31
|
+
+lG6tRo8QaFrH3afOmy4VUaG84Jm1XjNYnyaOfLb9ItpcQgVySn2c3aJ2PLcPljM
|
32
|
+
EhZUryAiV8KNMQ==
|
33
|
+
-----END CERTIFICATE-----
|
34
|
+
date: 2014-11-09 00:00:00.000000000 Z
|
35
|
+
dependencies: []
|
36
|
+
description: Tempfile to File
|
37
|
+
email:
|
38
|
+
- poulet_a@epitech.eu
|
39
|
+
- - lib/temptofile.rb
|
40
|
+
- README.md
|
41
|
+
- temptofile.gemspec
|
42
|
+
executables: []
|
43
|
+
extensions: []
|
44
|
+
extra_rdoc_files: []
|
45
|
+
files:
|
46
|
+
- README.md
|
47
|
+
- lib/temptofile.rb
|
48
|
+
- temptofile.gemspec
|
49
|
+
homepage: https://gitlab.com/poulet_a/temptofile
|
50
|
+
licenses:
|
51
|
+
- GNU/GPLv3
|
52
|
+
metadata: {}
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
requirements: []
|
68
|
+
rubyforge_project:
|
69
|
+
rubygems_version: 2.4.2
|
70
|
+
signing_key:
|
71
|
+
specification_version: 4
|
72
|
+
summary: "..."
|
73
|
+
test_files: []
|
metadata.gz.sig
ADDED
Binary file
|