WriterFileUtils 0.1.2

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5a02ecf808945007ee4f52fa384a47363137ac2efc261e24166389a0c65aff0a
4
+ data.tar.gz: d4901f90875076be5fdccc8666dbda7477a02e7bb8c052ed137176e5d0fa9809
5
+ SHA512:
6
+ metadata.gz: fbe38d4a93f31a65a7b1676d43c7a568f2d13731723b4569a47fd220b082af4a7c10cf392bc6dbb3b7b2e233bddb41b68aa8680fd54a27ae7770fb11f96d6cf5
7
+ data.tar.gz: c6cfb515851d55d268af23031e5188364f00ee8e7655c78895e4a630fb7b02d6b50594b665af2b6a345cd125caa95035112204177dc7f6d50a07ec7b146b91b2
@@ -0,0 +1,35 @@
1
+ # Projectdemo
2
+
3
+ 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/projectdemo`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'projectdemo'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install projectdemo
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/projectdemo.
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ puts "这个是我的第一个Ruby项目"
4
+
5
+ require 'projectdemo'
6
+ require 'pp'
7
+ # 接收命令行参数
8
+ pp ARGV # 执行 bundle exec main 12345 那么 12345 就是 命令行参数
9
+
10
+ # Ziyouzhe::Writer.write_to('/Users/majianjie/Downloads/Ruby/ruby_project_01/filename.rb','000这个是我的第1个Ruby项目!!!')
11
+ Ziyouzhe::Writer.write_to('/Users/majianjie/Downloads/Ruby/ruby_project_01/filename.rb','111这个是我的第2个Ruby项目!!!')
12
+ Ziyouzhe::Writer.write_to(ARGV[0],ARGV[1]) # 这里是接收命令行参数 写入的
@@ -0,0 +1,7 @@
1
+ require "projectdemo/version"
2
+
3
+ module Projectdemo
4
+ class Error < StandardError; end
5
+ # Your code goes here...
6
+ require_relative 'writeFile'
7
+ end
@@ -0,0 +1,3 @@
1
+ module Projectdemo
2
+ VERSION = "0.1.2"
3
+ end
@@ -0,0 +1,7 @@
1
+ module Ziyouzhe
2
+ class Writer
3
+ def self.write_to(file_path,content)
4
+ File.open(file_path,'w+') { |f| f.write(content)}
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: WriterFileUtils
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - ziyouzhe4
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-11-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.17'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.17'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: 第一个Ruby项目 ziyouzhe4
42
+ email:
43
+ - 592357262@qq.com
44
+ executables:
45
+ - main
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - README.md
50
+ - bin/main
51
+ - lib/projectdemo.rb
52
+ - lib/projectdemo/version.rb
53
+ - lib/writeFile.rb
54
+ homepage: https://github.com/ziyouzhe4/Awesome-Ruby.git
55
+ licenses: []
56
+ metadata: {}
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.0.8
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: 第一个Ruby项目 ziyouzhe4
76
+ test_files: []