file_to_tempfile 0.1.0 → 0.1.2

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
  SHA256:
3
- metadata.gz: 71f5dd9dbf8cfc5e01d9a68e44072ecf7d875152073dab04d3be6d97c06bca48
4
- data.tar.gz: b9cd1a3123ded9a855437a8d619c6e2276dedfa2060414d711c8a4ea435276e6
3
+ metadata.gz: 54217f11a4d57f3f050f92ec323be0b03c7adf33fd5d35801d1f68c43d5b3187
4
+ data.tar.gz: 848dcd39cb3a2fb40a02e5e98fa1a6d549944d39658cd067746ebc661f15e506
5
5
  SHA512:
6
- metadata.gz: fcd560a7724b4f4ec5f2faba236374c02d332a653aece2ca030762f73818c54be32a51455c0a7426a09506c8027640f5a097da3bd1c3074f961ba5f54550104f
7
- data.tar.gz: c96938eb9accb5be6eb89df34fd531f88749fa1193699279554d7b078d6fd175ee25388655b315ae6c68dfd9faf5ac03ecab102925a6a122c512479001a28bc7
6
+ metadata.gz: bca8123a9a6a89f86e656130a64fc5a1823881522e4f4772cfd326cdc89534f51324c7a169250e68166caa06602a85e5c96529ef4db7db87a60450434c74b88e
7
+ data.tar.gz: 9998aeaf6e31c14a0db077e8bb668d9b6af5fd0d7c985b8a31e33f63a6bc13dec8b14a637221e9e6a5c880ef157b47ebcfaf4cd98e9914456fe7d37d70e0ae64
data/README.md CHANGED
@@ -1,34 +1,34 @@
1
1
  # FileToTempfile
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/file_to_tempfile`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Easily convert a File object to a Tempfile object.
6
4
 
7
5
  ## Installation
8
6
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
7
+ Add this line to your application's Gemfile:
12
8
 
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
9
+ ```ruby
10
+ gem 'rubyt'
11
+ ```
14
12
 
15
- If bundler is not being used to manage dependencies, install the gem by executing:
13
+ And then execute:
16
14
 
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
15
+ ```sh
16
+ $ bundle install
17
+ ```
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
22
-
23
- ## Development
21
+ ```ruby
22
+ require 'file_to_tempfile'
24
23
 
25
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
+ file = File.open '.gitignore'
26
25
 
27
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
26
+ tempfile = FileToTempfile.convert(file)
27
+ ```
28
28
 
29
29
  ## Contributing
30
30
 
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/file_to_tempfile.
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ZaikoXander/file_to_tempfile.
32
32
 
33
33
  ## License
34
34
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FileToTempfile
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -1,4 +1,6 @@
1
1
  module FileToTempfile
2
2
  VERSION: String
3
3
  # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+
5
+ def self.convert: (File file, { using_path: bool }) -> Tempfile
4
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file_to_tempfile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZaikoXander