CQHTTP 2.2.0 → 2.2.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 +4 -4
- data/.rubocop.yml +2 -0
- data/Gemfile +2 -2
- data/README.en.md +6 -0
- data/README.md +6 -0
- data/Rakefile +3 -3
- data/bin/console +3 -3
- data/lib/CQHTTP/api.rb +1 -1
- data/lib/CQHTTP/network.rb +2 -1
- data/lib/CQHTTP/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b5d66b4056bcf2687ab4f674d53158541c129e0
|
4
|
+
data.tar.gz: 9ab26ffd1617116613f237c77d29d5b87168f77a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c876bdb54bfcebdbb634af5f728ca6aa3cb440d533db0e24ad0d16afb61eaa74e22c8956e9c2cc421a4b8d3e9d476d3039fab729d53ebfc37768b3949533ab5d
|
7
|
+
data.tar.gz: 1e3048a9d669e03a53446742b03ab03f4773e9feebaaeb824d99f05ca577e73fe47aeb4ea601c0b9fb21449e8a8930e49af0020b8c6f7ae3dd673de19173b71a
|
data/.rubocop.yml
ADDED
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
3
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in CQHTTP.gemspec
|
6
6
|
gemspec
|
data/README.en.md
CHANGED
@@ -22,6 +22,12 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
TODO: Write usage instructions here
|
24
24
|
|
25
|
+
### D-Bus
|
26
|
+
|
27
|
+
Service: `org.dastudio.qq`
|
28
|
+
Object path: `/org/dastudio/qq`
|
29
|
+
Interface: `org.dastudio.cqhttp`
|
30
|
+
|
25
31
|
## Development
|
26
32
|
|
27
33
|
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.
|
data/README.md
CHANGED
@@ -22,6 +22,12 @@ gem 'CQHTTP'
|
|
22
22
|
|
23
23
|
TODO: 写使用说明
|
24
24
|
|
25
|
+
### D-Bus
|
26
|
+
|
27
|
+
Service: `org.dastudio.qq`
|
28
|
+
Object path: `/org/dastudio/qq`
|
29
|
+
Interface: `org.dastudio.cqhttp`
|
30
|
+
|
25
31
|
## 开发
|
26
32
|
|
27
33
|
检出这个仓库后,运行 `bin/setup` 来安装依赖关系。然后,运行 `rake spec` 来运行测试。 您还可以运行 `bin/console` 启动交互式提示符(`irb`),让您进行实验。
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'CQHTTP'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "CQHTTP"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start(__FILE__)
|
data/lib/CQHTTP/api.rb
CHANGED
@@ -7,7 +7,7 @@ module CQHTTP
|
|
7
7
|
#
|
8
8
|
# host: String: API address, like 'http://localhost:5700'
|
9
9
|
# type: Symbol or String, 'get', 'form' or 'json;
|
10
|
-
def initialize(host: 'http://localhost:5700', way: :
|
10
|
+
def initialize(host: 'http://localhost:5700', way: :json)
|
11
11
|
@func_list = {}
|
12
12
|
gen
|
13
13
|
@func_list.freeze
|
data/lib/CQHTTP/network.rb
CHANGED
@@ -23,8 +23,8 @@ module CQHTTP
|
|
23
23
|
# uri: URI
|
24
24
|
# params (optional): Hash, url query
|
25
25
|
def self.get(uri, params = nil) # => Hash
|
26
|
-
puts 'GET URL:', uri if $DEBUG
|
27
26
|
uri.query = URI.encode_www_form params if params
|
27
|
+
puts 'GET URL:', uri if $DEBUG
|
28
28
|
error Net::HTTP.get_response(uri)
|
29
29
|
end
|
30
30
|
|
@@ -43,6 +43,7 @@ module CQHTTP
|
|
43
43
|
# body: Hash, post body
|
44
44
|
def self.post_json(uri, body)
|
45
45
|
puts 'POST URL:', uri if $DEBUG
|
46
|
+
puts 'POST JSON:', JSON.pretty_generate(body) if $DEBUG
|
46
47
|
error Net::HTTP.post(
|
47
48
|
uri,
|
48
49
|
body.to_json,
|
data/lib/CQHTTP/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: CQHTTP
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 71e6fd52
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,6 +76,7 @@ extra_rdoc_files: []
|
|
76
76
|
files:
|
77
77
|
- ".gitignore"
|
78
78
|
- ".rspec"
|
79
|
+
- ".rubocop.yml"
|
79
80
|
- CQHTTP.gemspec
|
80
81
|
- Gemfile
|
81
82
|
- README.en.md
|