net-socket 0.0.1 → 1.0.0

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
  SHA1:
3
- metadata.gz: c34f14fd3ccc2e318c29eaac5a6f88a65a4dd40d
4
- data.tar.gz: 938de9bf66a478a26d17a1e86708163f1ca3fded
3
+ metadata.gz: a3cc7260220edee9eb6ab50ce5275bd3d976b482
4
+ data.tar.gz: 4187326fa961b9d7564774e4dd9572688965cc64
5
5
  SHA512:
6
- metadata.gz: 6f3db470fb460a3a31950b3155d3ae1428ef162d7f984c8cff95df04aaf23dc0b9e6db8ac85126db2f1bddac8168d9e26cc65e3221762887f07f704fc0e8164e
7
- data.tar.gz: 889052ebb43a98d16c9d145b2d07fcd2a05688c6f8104185e56cd41155934a56194416de110673235abcc2d10b7dcc32aaf8ca140ff084002ef0b8d46eb65657
6
+ metadata.gz: 0c9db4572645b3f5236489381a6e876baf5431e97f99d2cdcc4848c4e5ddac9c21747c6e2763bfa605f4e8a9a73df261e6c0b903c8493364ef55ea73da74cce0
7
+ data.tar.gz: 0d9af8522f9f2db4ef9d3735256eafa7976e6db010c18586c1a42d2987897fdcade3d0dd148f3a4fe85e766340bd6539d89adf64a55cb0f64d118e8ee4966aa8
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at marie@heretical.technology. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $: << File.join(File.dirname(__FILE__), '..', 'lib')
4
+
5
+ require 'net/socket'
6
+
7
+ include Net::Socket
8
+
9
+ async = !!ARGV.delete('--async')
10
+
11
+ uri = URI.parse('http://da.gd/ip')
12
+ socket = TCP::Client.new(uri.host, uri.port)
13
+
14
+ socket.puts "GET #{uri.path} HTTP/1.1"
15
+ socket.puts "Host: #{uri.host}"
16
+ socket.puts "Accept: text/plain"
17
+ socket.puts ""
18
+
19
+ puts socket.read
20
+ socket.close
@@ -19,7 +19,7 @@ socket.each_request(async) do |conn|
19
19
  conn.write "HTTP/1.0 200 OK\r\n"
20
20
 
21
21
  # Start headers.
22
- conn.write "Server: Ruby Met::Socket example\r\n"
22
+ conn.write "Server: Ruby Net::Socket example\r\n"
23
23
  conn.write "Content-Type: text/html\r\n"
24
24
  conn.write "Content-Length: #{response.length}\r\n"
25
25
  conn.write "\r\n"
@@ -29,4 +29,4 @@ socket.each_request(async) do |conn|
29
29
  conn.write response
30
30
  end
31
31
 
32
- socket.wait
32
+ socket.wait
@@ -2,7 +2,7 @@ require 'net/socket/version'
2
2
 
3
3
  module Net::Socket
4
4
  module TCP
5
- #require 'net/socket/tcp/client'
5
+ require 'net/socket/tcp/client'
6
6
  require 'net/socket/tcp/server'
7
7
  end
8
8
  end
@@ -2,6 +2,6 @@ require 'net/socket/socket-hack'
2
2
 
3
3
  module Net
4
4
  module Socket
5
- VERSION = "0.0.1"
5
+ VERSION = "1.0.0"
6
6
  end
7
7
  end
data/net-socket.gemspec CHANGED
@@ -9,9 +9,9 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Marie Markwell"]
10
10
  spec.email = ["me@marie.so"]
11
11
 
12
- spec.summary = %q{A nice wrapper for Ruby's built in socket APIs.}
12
+ spec.summary = %q{A better socket API.}
13
13
  spec.description = spec.summary
14
- spec.homepage = "https://gitlab.com/spinny/net-socket"
14
+ spec.homepage = "https://github.com/heresy/net-socket"
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-socket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marie Markwell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-08 00:00:00.000000000 Z
11
+ date: 2016-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
- description: A nice wrapper for Ruby's built in socket APIs.
41
+ description: A better socket API.
42
42
  email:
43
43
  - me@marie.so
44
44
  executables: []
@@ -48,12 +48,14 @@ files:
48
48
  - ".gitignore"
49
49
  - ".rspec"
50
50
  - ".travis.yml"
51
+ - CODE_OF_CONDUCT.md
51
52
  - Gemfile
52
53
  - LICENSE
53
54
  - README.markdown
54
55
  - Rakefile
55
56
  - bin/console
56
57
  - bin/setup
58
+ - examples/http-client.rb
57
59
  - examples/http-server.rb
58
60
  - lib/net/socket.rb
59
61
  - lib/net/socket/socket-hack.rb
@@ -62,7 +64,7 @@ files:
62
64
  - lib/net/socket/tcp/server.rb
63
65
  - lib/net/socket/version.rb
64
66
  - net-socket.gemspec
65
- homepage: https://gitlab.com/spinny/net-socket
67
+ homepage: https://github.com/heresy/net-socket
66
68
  licenses:
67
69
  - MIT
68
70
  metadata: {}
@@ -82,9 +84,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
84
  version: '0'
83
85
  requirements: []
84
86
  rubyforge_project:
85
- rubygems_version: 2.2.2
87
+ rubygems_version: 2.5.1
86
88
  signing_key:
87
89
  specification_version: 4
88
- summary: A nice wrapper for Ruby's built in socket APIs.
90
+ summary: A better socket API.
89
91
  test_files: []
90
- has_rdoc: