fast_packager 0.0.1
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
- data/Gemfile +8 -0
- data/Gemfile.lock +19 -0
- data/README.md +119 -0
- data/Rakefile +4 -0
- data/lib/fast_packager_test/version.rb +5 -0
- data/lib/fast_packager_test.rb +14 -0
- data/lib/ruby_demo.rb +78 -0
- data/sig/fast_packager_test.rbs +4 -0
- metadata +50 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f71b4249a653c57756651e21233a4243ae392dfd362b5ba04387b04dd04b8f2b
|
4
|
+
data.tar.gz: 112fa7744820ad71bc9b92bc5dd04accfcecc275d0a9cdadc799a8e190c56812
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fff0b00f377fa4d92ee677fcb00f15a553bdc1eb3708a1d3484dbc57bdb7d08aa942c88d1f3d9adc894aa3ed03783a1396fadaed8f2830b3047abd2e1d21d36c
|
7
|
+
data.tar.gz: bd9c2c51d744a82a9b874bcde48e58a23b2d492c6f65f9caded32319e367d647ba207094fdf54387c1837a86207e5c98f8512ef7cfc5972241340c7b0f734f82
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
fast_packager_test (0.1.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
rake (13.0.6)
|
10
|
+
|
11
|
+
PLATFORMS
|
12
|
+
x86_64-darwin-20
|
13
|
+
|
14
|
+
DEPENDENCIES
|
15
|
+
fast_packager_test!
|
16
|
+
rake (~> 13.0)
|
17
|
+
|
18
|
+
BUNDLED WITH
|
19
|
+
2.3.19
|
data/README.md
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
# FastPackagerTest
|
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/fast_packager_test`. 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
|
+
Install the gem and add to the application's Gemfile by executing:
|
10
|
+
|
11
|
+
$ bundle add fast_packager_test
|
12
|
+
|
13
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
14
|
+
|
15
|
+
$ gem install fast_packager_test
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
TODO: Write usage instructions here
|
20
|
+
|
21
|
+
## Development
|
22
|
+
|
23
|
+
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.
|
24
|
+
|
25
|
+
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
|
+
|
27
|
+
## Contributing
|
28
|
+
|
29
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/fast_packager_test.
|
30
|
+
|
31
|
+
|
32
|
+
## 第一阶段(制作并上传gem)
|
33
|
+
|
34
|
+
- 生成初始化project
|
35
|
+
|
36
|
+
|
37
|
+
$bundle gem project_name
|
38
|
+
|
39
|
+
|
40
|
+
- 修改文件
|
41
|
+
|
42
|
+
|
43
|
+
修改project_name.gemspec文件
|
44
|
+
|
45
|
+
修改
|
46
|
+
spec.summary = 'desc1' (这里任意为空或任意其他字符串)
|
47
|
+
spec.description = "desc2" (这里任意为空或任意其他字符串)
|
48
|
+
注释
|
49
|
+
spec.metadata["allowed_push_host"]
|
50
|
+
spec.metadata["homepage_uri"]
|
51
|
+
spec.metadata["source_code_uri"]
|
52
|
+
spec.metadata["changelog_uri"]
|
53
|
+
|
54
|
+
|
55
|
+
- 制作gem
|
56
|
+
|
57
|
+
|
58
|
+
$gem build project_name.gemspec
|
59
|
+
|
60
|
+
得到一个project_name.gemspec文件中{spec.name相同名称}-{spec.version}.gem的文件
|
61
|
+
|
62
|
+
|
63
|
+
- 上传gem
|
64
|
+
|
65
|
+
|
66
|
+
gem官网注册账号,注册完成执行
|
67
|
+
$gem sin signin (输入邮箱及密码)
|
68
|
+
|
69
|
+
API Key name (回车)
|
70
|
+
index_rubygems: y
|
71
|
+
push_rubygem: y
|
72
|
+
yank_rubygem: y
|
73
|
+
add_owner: y
|
74
|
+
remove_owner: y
|
75
|
+
access_webhooks: y
|
76
|
+
show_dashboard: n
|
77
|
+
|
78
|
+
凭证存放在$HOME/.local/share/gem/credentials (之后登录依靠此凭证,如果想重新输入账号密码把这个文件删除即可)
|
79
|
+
|
80
|
+
$gem push {spec.name}-{spec.version}.gem
|
81
|
+
提示:
|
82
|
+
Pushing gem to https://rubygems.org...
|
83
|
+
Successfully registered gem: spec.name (spec.version)
|
84
|
+
|
85
|
+
|
86
|
+
- 下载安装测试
|
87
|
+
|
88
|
+
|
89
|
+
查看本地已安装gem包列表
|
90
|
+
$gem list | grep {spec.name}-{spec.version}.gem
|
91
|
+
结果: 无
|
92
|
+
|
93
|
+
本地安装gem包
|
94
|
+
$gem install ./{spec.name}-{spec.version}.gem
|
95
|
+
|
96
|
+
检查本地已安装gem包列表
|
97
|
+
$gem list | grep {spec.name}-{spec.version}.gem
|
98
|
+
结果: {spec.name} ({spec.version})
|
99
|
+
|
100
|
+
删除本地安装的gem包后安装公共public repo gem
|
101
|
+
$gem uninstall fast_packager_test
|
102
|
+
结果: Successfully uninstalled {spec.name}-{spec.version}
|
103
|
+
检查本地已安装gem包列表
|
104
|
+
$gem list | grep {spec.name}-{spec.version}.gem
|
105
|
+
结果: 无
|
106
|
+
下载public repo gem
|
107
|
+
$gem install fast_packager_test
|
108
|
+
检查本地已安装gem包列表
|
109
|
+
$gem list | grep {spec.name}-{spec.version}.gem
|
110
|
+
结果: {spec.name} ({spec.version})
|
111
|
+
|
112
|
+
|
113
|
+
## 一些文件的生成
|
114
|
+
|
115
|
+
- Gemfile.lock
|
116
|
+
|
117
|
+
|
118
|
+
本地运行调试即生成
|
119
|
+
$irb (ruby的命令行交互模式)
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "fast_packager_test/version"
|
4
|
+
|
5
|
+
module FastPackagerTest
|
6
|
+
class Error < StandardError; end
|
7
|
+
# Your code goes here...
|
8
|
+
end
|
9
|
+
|
10
|
+
class TestLong
|
11
|
+
def self.hi
|
12
|
+
puts "Hello world! Testlong"
|
13
|
+
end
|
14
|
+
end
|
data/lib/ruby_demo.rb
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
class Customer
|
2
|
+
@@no_of_customers=0
|
3
|
+
def initialize(id, name, addr)
|
4
|
+
@cust_id=id
|
5
|
+
@cust_name=name
|
6
|
+
@cust_addr=addr
|
7
|
+
end
|
8
|
+
def display_details()
|
9
|
+
puts "Customer id #@cust_id"
|
10
|
+
puts "Customer name #@cust_name"
|
11
|
+
puts "Customer address #@cust_addr"
|
12
|
+
end
|
13
|
+
def total_no_of_customers()
|
14
|
+
@@no_of_customers += 1
|
15
|
+
puts "Total number of customers: #@@no_of_customers"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# 创建对象
|
20
|
+
# cust1=Customer.new("1", "John", "Wisdom Apartments, Ludhiya")
|
21
|
+
# cust2=Customer.new("1", "Poul", "New Empire road, Khandala")
|
22
|
+
|
23
|
+
# 调用方法
|
24
|
+
# cust1.display_details()
|
25
|
+
# cust1.total_no_of_customers()
|
26
|
+
# cust2.display_details()
|
27
|
+
# cust2.total_no_of_customers()
|
28
|
+
|
29
|
+
# A='1'
|
30
|
+
# puts "=======#{A}"
|
31
|
+
# defined? variable # 如果 variable 已经初始化,则为 True
|
32
|
+
# foo = 42
|
33
|
+
# defined? foo # => "local-variable"
|
34
|
+
# defined? $_ # => "global-variable"
|
35
|
+
# defined? bar # => nil(未定义)
|
36
|
+
|
37
|
+
# MR_COUNT = 0 # 定义在主 Object 类上的常量
|
38
|
+
# module Foo
|
39
|
+
# MR_COUNT = 0
|
40
|
+
# ::MR_COUNT = 1 # 设置全局计数为 1
|
41
|
+
# MR_COUNT = 2 # 设置局部计数为 2
|
42
|
+
# end
|
43
|
+
# puts MR_COUNT # 这是全局常量
|
44
|
+
# puts Foo::MR_COUNT # 这是 "Foo" 的局部常量
|
45
|
+
|
46
|
+
CONST = ' out there'
|
47
|
+
class Inside_one
|
48
|
+
CONST = proc {' in there'}
|
49
|
+
def where_is_my_CONST
|
50
|
+
::CONST + ' inside one'
|
51
|
+
end
|
52
|
+
end
|
53
|
+
class Inside_two
|
54
|
+
CONST = ' inside two'
|
55
|
+
def where_is_my_CONST
|
56
|
+
CONST
|
57
|
+
end
|
58
|
+
end
|
59
|
+
# puts Inside_one.new.where_is_my_CONST
|
60
|
+
# puts Inside_two.new.where_is_my_CONST
|
61
|
+
# puts Object::CONST + Inside_two::CONST
|
62
|
+
# puts Inside_two::CONST + CONST
|
63
|
+
# puts Inside_one::CONST
|
64
|
+
# puts Inside_one::CONST.call
|
65
|
+
# puts Inside_one::CONST.call + Inside_two::CONST
|
66
|
+
|
67
|
+
=begin
|
68
|
+
asdfasdfsadfsadfsdfsdf
|
69
|
+
=end
|
70
|
+
|
71
|
+
|
72
|
+
for i in 0..5 do
|
73
|
+
puts i
|
74
|
+
end
|
75
|
+
|
76
|
+
(0..5).each do |i|
|
77
|
+
puts i
|
78
|
+
end
|
metadata
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fast_packager
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- TestLong-Amos
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-08-07 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: debug2
|
14
|
+
email: 13512119091@163.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- Gemfile
|
20
|
+
- Gemfile.lock
|
21
|
+
- README.md
|
22
|
+
- Rakefile
|
23
|
+
- lib/fast_packager_test.rb
|
24
|
+
- lib/fast_packager_test/version.rb
|
25
|
+
- lib/ruby_demo.rb
|
26
|
+
- sig/fast_packager_test.rbs
|
27
|
+
homepage: https://rubygems.org/gems/fast_packager
|
28
|
+
licenses:
|
29
|
+
- MIT
|
30
|
+
metadata: {}
|
31
|
+
post_install_message:
|
32
|
+
rdoc_options: []
|
33
|
+
require_paths:
|
34
|
+
- lib
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 2.6.0
|
40
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
requirements: []
|
46
|
+
rubygems_version: 3.3.19
|
47
|
+
signing_key:
|
48
|
+
specification_version: 4
|
49
|
+
summary: debug1
|
50
|
+
test_files: []
|