sugilite 0.1.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8372d6d84d8a9954963d5ef7bc360f3486e876286315474c4807dbfa0aa88699
4
+ data.tar.gz: 41c023c6d77e356c74bb2504777b99059ac5ac84a167dce5b93dd4ff541a7c64
5
+ SHA512:
6
+ metadata.gz: 6a0edd4fb91a9b09860e7a6f2b33d91aa45bb2321c42b334ac6c02cda658a779aec6a6ce7667f3964fd278143266ff4361dbdaafe4dace426ab999280214d42c
7
+ data.tar.gz: 68a655c0218c41ae73b03838e0480b251752169c03e0f81b77f48a4b32c79cf89e9461cf9c9b65476e10fcf9a9f0406d86829372bf09191082875cb6bf643c32
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ *.bundle
10
+ *.so
11
+ *.o
12
+ *.a
13
+ mkmf.log
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$" />
8
+ <orderEntry type="jdk" jdkName="RVM: ruby-2.6.3" jdkType="RUBY_SDK" />
9
+ <orderEntry type="sourceFolder" forTests="false" />
10
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.0.2, RVM: ruby-2.6.3) [gem]" level="application" />
11
+ <orderEntry type="library" scope="PROVIDED" name="domain_name (v0.5.20190701, RVM: ruby-2.6.3) [gem]" level="application" />
12
+ <orderEntry type="library" scope="PROVIDED" name="eventmachine (v1.2.7, RVM: ruby-2.6.3) [gem]" level="application" />
13
+ <orderEntry type="library" scope="PROVIDED" name="faye-websocket (v0.10.9, RVM: ruby-2.6.3) [gem]" level="application" />
14
+ <orderEntry type="library" scope="PROVIDED" name="http-accept (v1.7.0, RVM: ruby-2.6.3) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="http-cookie (v1.0.3, RVM: ruby-2.6.3) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="mime-types (v3.2.2, RVM: ruby-2.6.3) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="mime-types-data (v3.2019.0331, RVM: ruby-2.6.3) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="minitest (v5.11.3, RVM: ruby-2.6.3) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="netrc (v0.11.0, RVM: ruby-2.6.3) [gem]" level="application" />
20
+ <orderEntry type="library" scope="PROVIDED" name="oj (v3.9.0, RVM: ruby-2.6.3) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="rake (v10.5.0, RVM: ruby-2.6.3) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="rake-compiler (v1.0.7, RVM: ruby-2.6.3) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="rest-client (v2.1.0, RVM: ruby-2.6.3) [gem]" level="application" />
24
+ <orderEntry type="library" scope="PROVIDED" name="unf (v0.1.4, RVM: ruby-2.6.3) [gem]" level="application" />
25
+ <orderEntry type="library" scope="PROVIDED" name="unf_ext (v0.0.7.6, RVM: ruby-2.6.3) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="websocket-driver (v0.7.1, RVM: ruby-2.6.3) [gem]" level="application" />
27
+ <orderEntry type="library" scope="PROVIDED" name="websocket-extensions (v0.1.4, RVM: ruby-2.6.3) [gem]" level="application" />
28
+ </component>
29
+ </module>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="JavaScriptSettings">
4
+ <option name="languageLevel" value="ES6" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.6.3 [global]" project-jdk-type="RUBY_SDK" />
7
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/Sugilite.iml" filepath="$PROJECT_DIR$/.idea/Sugilite.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,135 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="57504d54-f0fa-44f7-acfa-562aeaf32108" name="Default Changelist" comment="">
5
+ <change afterPath="$PROJECT_DIR$/.idea/Sugilite.iml" afterDir="false" />
6
+ <change beforePath="$PROJECT_DIR$/.idea/.rakeTasks" beforeDir="false" />
7
+ <change beforePath="$PROJECT_DIR$/.idea/Amethyst.iml" beforeDir="false" />
8
+ <change beforePath="$PROJECT_DIR$/.idea/discord.xml" beforeDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
10
+ <change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
11
+ <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
12
+ <change beforePath="$PROJECT_DIR$/Amethyst.gemspec" beforeDir="false" />
13
+ <change beforePath="$PROJECT_DIR$/CHANGELOG.md" beforeDir="false" />
14
+ <change beforePath="$PROJECT_DIR$/CODE_OF_CONDUCT.md" beforeDir="false" afterPath="$PROJECT_DIR$/CODE_OF_CONDUCT.md" afterDir="false" />
15
+ <change beforePath="$PROJECT_DIR$/Gemfile" beforeDir="false" afterPath="$PROJECT_DIR$/Gemfile" afterDir="false" />
16
+ <change beforePath="$PROJECT_DIR$/Gemfile.lock" beforeDir="false" />
17
+ <change beforePath="$PROJECT_DIR$/LICENSE.txt" beforeDir="false" afterPath="$PROJECT_DIR$/LICENSE.txt" afterDir="false" />
18
+ <change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
19
+ <change beforePath="$PROJECT_DIR$/Rakefile" beforeDir="false" afterPath="$PROJECT_DIR$/Rakefile" afterDir="false" />
20
+ <change beforePath="$PROJECT_DIR$/bin/console" beforeDir="false" afterPath="$PROJECT_DIR$/bin/console" afterDir="false" />
21
+ <change beforePath="$PROJECT_DIR$/exe/Amethyst" beforeDir="false" />
22
+ <change beforePath="$PROJECT_DIR$/ext/Amethyst/Amethyst.c" beforeDir="false" />
23
+ <change beforePath="$PROJECT_DIR$/ext/Amethyst/Amethyst.h" beforeDir="false" />
24
+ <change beforePath="$PROJECT_DIR$/ext/Amethyst/extconf.rb" beforeDir="false" />
25
+ <change beforePath="$PROJECT_DIR$/lib/Amethyst.rb" beforeDir="false" />
26
+ <change beforePath="$PROJECT_DIR$/lib/Amethyst/version.rb" beforeDir="false" />
27
+ <change beforePath="$PROJECT_DIR$/lib/AmethystIRC.rb" beforeDir="false" />
28
+ <change beforePath="$PROJECT_DIR$/test/Amethyst_test.rb" beforeDir="false" />
29
+ <change beforePath="$PROJECT_DIR$/test/test_helper.rb" beforeDir="false" afterPath="$PROJECT_DIR$/test/test_helper.rb" afterDir="false" />
30
+ </list>
31
+ <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
32
+ <option name="SHOW_DIALOG" value="false" />
33
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
34
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
35
+ <option name="LAST_RESOLUTION" value="IGNORE" />
36
+ </component>
37
+ <component name="FileTemplateManagerImpl">
38
+ <option name="RECENT_TEMPLATES">
39
+ <list>
40
+ <option value="Ruby File" />
41
+ </list>
42
+ </option>
43
+ </component>
44
+ <component name="Git.Settings">
45
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
46
+ </component>
47
+ <component name="ProjectId" id="1PkLhaM6hxUTLPoF3xESL3MChft" />
48
+ <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
49
+ <component name="PropertiesComponent">
50
+ <property name="ASKED_SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
51
+ <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
52
+ <property name="WebServerToolWindowFactoryState" value="false" />
53
+ <property name="last_opened_file_path" value="$PROJECT_DIR$/bin/Amethyst.rb" />
54
+ <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
55
+ <property name="nodejs_npm_path_reset_for_default_project" value="true" />
56
+ <property name="settings.editor.selected.configurable" value="org.jetbrains.plugins.ruby.settings.RubyActiveModuleSdkConfigurable" />
57
+ </component>
58
+ <component name="RunDashboard">
59
+ <option name="ruleStates">
60
+ <list>
61
+ <RuleState>
62
+ <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
63
+ </RuleState>
64
+ <RuleState>
65
+ <option name="name" value="StatusDashboardGroupingRule" />
66
+ </RuleState>
67
+ </list>
68
+ </option>
69
+ </component>
70
+ <component name="RunManager">
71
+ <configuration name="Unnamed" type="RubyRunConfigurationType" factoryName="Ruby" nameIsGenerated="true">
72
+ <module name="Amethyst" />
73
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="" />
74
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
75
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
76
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
77
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
78
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
79
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
80
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov">
81
+ <COVERAGE_PATTERN ENABLED="true">
82
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
83
+ </COVERAGE_PATTERN>
84
+ </EXTENSION>
85
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$MODULE_DIR$/bin/Amethyst.rb" />
86
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
87
+ <method v="2" />
88
+ </configuration>
89
+ </component>
90
+ <component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" />
91
+ <component name="SvnConfiguration">
92
+ <configuration />
93
+ </component>
94
+ <component name="TaskManager">
95
+ <task active="true" id="Default" summary="Default task">
96
+ <changelist id="57504d54-f0fa-44f7-acfa-562aeaf32108" name="Default Changelist" comment="" />
97
+ <created>1561589698775</created>
98
+ <option name="number" value="Default" />
99
+ <option name="presentableId" value="Default" />
100
+ <updated>1561589698775</updated>
101
+ <workItem from="1561589705749" duration="435000" />
102
+ <workItem from="1562129682016" duration="738000" />
103
+ <workItem from="1564607363695" duration="60000" />
104
+ <workItem from="1566413269977" duration="280000" />
105
+ <workItem from="1566413585274" duration="137000" />
106
+ <workItem from="1566413854554" duration="542000" />
107
+ <workItem from="1566489040129" duration="346000" />
108
+ <workItem from="1566681371055" duration="995000" />
109
+ <workItem from="1566862987328" duration="64000" />
110
+ <workItem from="1566924091729" duration="2547000" />
111
+ <workItem from="1566930505937" duration="52000" />
112
+ <workItem from="1566930558623" duration="277000" />
113
+ </task>
114
+ <servers />
115
+ </component>
116
+ <component name="TypeScriptGeneratedFilesManager">
117
+ <option name="version" value="1" />
118
+ </component>
119
+ <component name="Vcs.Log.Tabs.Properties">
120
+ <option name="TAB_STATES">
121
+ <map>
122
+ <entry key="MAIN">
123
+ <value>
124
+ <State>
125
+ <option name="COLUMN_ORDER" />
126
+ </State>
127
+ </value>
128
+ </entry>
129
+ </map>
130
+ </option>
131
+ </component>
132
+ <component name="com.intellij.coverage.CoverageDataManagerImpl">
133
+ <SUITE FILE_PATH="coverage/Amethyst@Unnamed.rcov" NAME="Unnamed Coverage Results" MODIFIED="1566413500042" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" MODULE_NAME="Amethyst" />
134
+ </component>
135
+ </project>
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.3
7
+ before_install: gem install bundler -v 2.0.2
@@ -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 nathanec@gmail.com. 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/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in Sugilite.gemspec
4
+ gemspec
@@ -0,0 +1,54 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ Sugilite (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ domain_name (0.5.20190701)
10
+ unf (>= 0.0.5, < 1.0.0)
11
+ eventmachine (1.2.7)
12
+ faye-websocket (0.10.9)
13
+ eventmachine (>= 0.12.0)
14
+ websocket-driver (>= 0.5.1)
15
+ http-accept (1.7.0)
16
+ http-cookie (1.0.3)
17
+ domain_name (~> 0.5)
18
+ mime-types (3.2.2)
19
+ mime-types-data (~> 3.2015)
20
+ mime-types-data (3.2019.0331)
21
+ minitest (5.11.3)
22
+ netrc (0.11.0)
23
+ oj (3.9.0)
24
+ rake (10.5.0)
25
+ rake-compiler (1.0.7)
26
+ rake
27
+ rest-client (2.1.0)
28
+ http-accept (>= 1.7.0, < 2.0)
29
+ http-cookie (>= 1.0.2, < 2.0)
30
+ mime-types (>= 1.16, < 4.0)
31
+ netrc (~> 0.8)
32
+ unf (0.1.4)
33
+ unf_ext
34
+ unf_ext (0.0.7.6)
35
+ websocket-driver (0.7.1)
36
+ websocket-extensions (>= 0.1.0)
37
+ websocket-extensions (0.1.4)
38
+
39
+ PLATFORMS
40
+ ruby
41
+
42
+ DEPENDENCIES
43
+ Sugilite!
44
+ bundler (~> 2.0)
45
+ eventmachine (~> 1.2, >= 1.2.7)
46
+ faye-websocket (~> 0.10.9)
47
+ minitest (~> 5.0)
48
+ oj (~> 3.9.0)
49
+ rake (~> 10.0)
50
+ rake-compiler (~> 1.0.7)
51
+ rest-client (~> 2.1.0)
52
+
53
+ BUNDLED WITH
54
+ 2.0.2
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 MediaMagnet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,41 @@
1
+ # Sugilite
2
+
3
+ Sugilite, A Gem to pull data from Twitch via the IRC chat and TMI
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'Sugilite'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install Sugilite
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ 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).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitLab at https://gitlab.com/mediamagnet/Sugilite. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
34
+
35
+ ## License
36
+
37
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
38
+
39
+ ## Code of Conduct
40
+
41
+ Everyone interacting in the Sugilite project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/Sugilite/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,18 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ require "rake/extensiontask"
11
+
12
+ task :build => :compile
13
+
14
+ Rake::ExtensionTask.new("Sugilite") do |ext|
15
+ ext.lib_dir = "lib/Sugilite"
16
+ end
17
+
18
+ task :default => [:clobber, :compile, :test]
@@ -0,0 +1,40 @@
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "Sugilite/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "sugilite"
7
+ spec.version = Sugilite::VERSION
8
+ spec.authors = ["MediaMagnet"]
9
+ spec.email = ["nathanec@gmail.com"]
10
+
11
+ spec.summary = 'Twitch chat client gem using websockets'
12
+ spec.description = 'Twitch chat client gem using websockets and twitch irc'
13
+ spec.homepage = 'https://gitlab.com/MediaMagnet/Sugilite'
14
+ spec.license = 'MIT'
15
+
16
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
17
+
18
+ spec.metadata["homepage_uri"] = spec.homepage
19
+ spec.metadata['source_code_uri'] = 'https://gitlab.com/MediaMagnet/Sugilite'
20
+ spec.metadata['changelog_uri'] = 'https://gitlab.com/MediaMagnet/Sugilite/blob/Sugilite/CHANGELOG.md'
21
+
22
+ # Specify which files should be added to the gem when it is released.
23
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
25
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+ spec.extensions = ["ext/Sugilite/extconf.rb"]
31
+
32
+ spec.add_development_dependency 'bundler', '~> 2.0'
33
+ spec.add_development_dependency 'eventmachine', '~> 1.2', '>= 1.2.7'
34
+ spec.add_development_dependency 'faye-websocket', '~> 0.10.9'
35
+ spec.add_development_dependency 'minitest', '~> 5.0'
36
+ spec.add_development_dependency 'oj', '~> 3.9.0'
37
+ spec.add_development_dependency 'rake', '~> 10.0'
38
+ spec.add_development_dependency 'rake-compiler', '~> 1.0.7'
39
+ spec.add_development_dependency 'rest-client', '~> 2.1.0'
40
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "Sugilite"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "Sugilite"
@@ -0,0 +1,9 @@
1
+ #include "Sugilite.h"
2
+
3
+ VALUE rb_mSugilite;
4
+
5
+ void
6
+ Init_Sugilite(void)
7
+ {
8
+ rb_mSugilite = rb_define_module("Sugilite");
9
+ }
@@ -0,0 +1,6 @@
1
+ #ifndef SUGILITE_H
2
+ #define SUGILITE_H 1
3
+
4
+ #include "ruby.h"
5
+
6
+ #endif /* SUGILITE_H */
@@ -0,0 +1,3 @@
1
+ require "mkmf"
2
+
3
+ create_makefile("Sugilite/Sugilite")
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen-string-literal: true
3
+
4
+ #require 'Sugilite/version'
5
+ # require 'Sugilite/Sugilite'
6
+ require 'oj'
7
+ require 'faye/websocket'
8
+ require 'eventmachine'
9
+ require 'rest-client'
10
+ local_dir = File.expand_path('../')
11
+ $LOAD_PATH.unshift(local_dir)
12
+ require 'SugiliteIRC.rb'
13
+
14
+ # Work with Twitch TMI to pull data
15
+ module Sugilite
16
+ # Errors?
17
+ class Error < StandardError; end
18
+ # Get the user list from TMI all methods return arrays
19
+ class GetUserList
20
+ # Channel name.
21
+ attr_accessor :channel
22
+
23
+ # New message
24
+ def initialize(channel)
25
+ # Users Channel
26
+ @channel = channel
27
+ end
28
+
29
+ # url
30
+ def url
31
+ @url = "https://tmi.twitch.tv/group/user/#{@channel}/chatters"
32
+ end
33
+
34
+ # list all users on channel
35
+ def all
36
+ userlist = []
37
+ getchan = RestClient.get @url
38
+ userary = Oj.load(getchan).fetch('chatters')
39
+ userary.keys.each { |k| userary[k].each { |user| userlist.push(user) } }
40
+ userlist
41
+ end
42
+
43
+ # lists the broadcaster in channel
44
+ def broadcaster
45
+ getchan = RestClient.get @url
46
+ userary = Oj.load(getchan).fetch('chatters').fetch('broadcaster')
47
+ userary
48
+ end
49
+
50
+ # lists any vips in channel
51
+ def vip
52
+ getchan = RestClient.get @url
53
+ userary = Oj.load(getchan).fetch('chatters').fetch('vips')
54
+ userary
55
+ end
56
+
57
+ # lists any moderators in channel
58
+ def moderator
59
+ getchan = RestClient.get @url
60
+ userary = Oj.load(getchan).fetch('chatters').fetch('moderators')
61
+ userary
62
+ end
63
+
64
+ # lists any staff in channel
65
+ def staff
66
+ getchan = RestClient.get @url
67
+ userary = Oj.load(getchan).fetch('chatters').fetch('staff')
68
+ userary
69
+ end
70
+
71
+ # lists any admins in channel
72
+ def admin
73
+ getchan = RestClient.get @url
74
+ userary = Oj.load(getchan).fetch('chatters').fetch('admins')
75
+ userary
76
+ end
77
+
78
+ # lists any global moderators in channel (possibly depricated)
79
+ def global_mod
80
+ getchan = RestClient.get @url
81
+ userary = Oj.load(getchan).fetch('chatters').fetch('global_mods')
82
+ userary
83
+ end
84
+
85
+ # lists viewers
86
+ def viewer
87
+ getchan = RestClient.get @url
88
+ userary = Oj.load(getchan).fetch('chatters').fetch('viewers')
89
+ userary
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Sugilite Twitch Chat Reader.
4
+ module Sugilite
5
+ # Current Version 0.1.1
6
+ VERSION = "0.1.1"
7
+ end
@@ -0,0 +1,173 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'oj'
5
+
6
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
7
+
8
+ # Obtains information about IRC messages
9
+ module SugiliteIRC
10
+ # Displays contents of the message prefix
11
+ class Prefix
12
+ # User's real name.
13
+ attr_reader :realname
14
+ # User's username.
15
+ attr_reader :username
16
+ # User's hostname
17
+ attr_reader :hostname
18
+ # Initialize a new message prefix
19
+ def initialize(data)
20
+ @realname = @username = @hostname = ''
21
+ if data[0] == ':'
22
+ data2 = data[1..-1].split(/[!@]/)
23
+ @realname = data2[0]
24
+ @username = data2[1]
25
+ @hostname = data2[2]
26
+ end
27
+ end
28
+ end
29
+
30
+ # Parses standard IRC messages
31
+ class Message
32
+ # Raw message
33
+ attr_reader :raw
34
+ # Message tags
35
+ attr_reader :tags
36
+ # Message parameters
37
+ attr_reader :parameters
38
+ # Message prefix
39
+ attr_reader :prefix
40
+ # Message commands (i.e. PING and PRIVMSG)
41
+ attr_reader :command
42
+ # Initalizes message
43
+ def initialize(data)
44
+ @raw = data
45
+ @tags = {}
46
+ @parameters = []
47
+ @prefix = nil
48
+ data = data.split(' ')
49
+ data2 = data.shift
50
+ if data2[0] == '@'
51
+ data2[1..-1].split(';').each { |r_tag| s_tag = r_tag.split('=', 2); @tags[s_tag[0]] = s_tag[1] }
52
+ data2 = data.shift
53
+ end
54
+ if data2[0] == ':'
55
+ @prefix = Prefix.new(data2)
56
+ data2 = data.shift
57
+ end
58
+ @command = data2
59
+ loop do
60
+ if data[0].nil?
61
+ break
62
+ elsif data[0][0] == ':'
63
+ @parameters.push(data.join(' ')[1..-1])
64
+ break
65
+ elsif data.length == 1
66
+ @parameters.push(data[0])
67
+ break
68
+ else
69
+ @parameters.push(data.shift)
70
+ end
71
+ end
72
+ end
73
+
74
+ # Dumps from JSON object to String.
75
+ def to_s
76
+ Oj.dump self, indent: 2
77
+ end
78
+
79
+ # Gets Channel from irc data.
80
+ def channel
81
+ case @command
82
+ when 'PRIVMSG', 'NOTICE', 'HOSTTARGET', 'ROOMSTATE', 'USERNOTICE', 'USERSTATE'
83
+ @parameters[0]
84
+ else
85
+ nil
86
+ end
87
+ end
88
+
89
+ # Gets the sender.
90
+ def sender
91
+ case @command
92
+ when 'PRIVMSG', 'NOTICE'
93
+ @prefix.realname
94
+ else
95
+ nil
96
+ end
97
+ end
98
+
99
+ # Gets message contents as a string.
100
+ def message
101
+ case @command
102
+ when 'PRIVMSG', 'NOTICE'
103
+ @parameters[1]
104
+ else
105
+ nil
106
+ end
107
+ end
108
+ end
109
+
110
+ # Extra parsing for Twitch.tv's uniqueness.
111
+ class TwitchMessage < Message
112
+ # Get total bits in message if there are bits otherwise return empty value
113
+ def bits
114
+ @tags['bits'].to_i
115
+ end
116
+
117
+ # Is the user a moderator or broadcaster?
118
+ def moderator?
119
+ (@tags['badges'].include? 'moderator') || broadcaster?
120
+ end
121
+
122
+ # Is the user a broadcaster?
123
+ def broadcaster?
124
+ @tags['badges'].include? 'broadcaster'
125
+ end
126
+
127
+ # Is the user a subscriber?
128
+ def subscriber?
129
+ @tags['badges'].include? 'subscriber'
130
+ end
131
+
132
+ # Is the user a Twitch Turbo user?
133
+ def turbo?
134
+ @tags['badges'].include? 'turbo'
135
+ end
136
+
137
+ # Is the user a Twitch Prime user?
138
+ def prime?
139
+ @tags['badges'].include? 'premium'
140
+ end
141
+
142
+ # Is the user a partner?
143
+ def partner?
144
+ @tags['badges'].include? 'partner'
145
+ end
146
+
147
+ # Is the user a vip?
148
+ def vip?
149
+ @tags['badges'].include? 'vip'
150
+ end
151
+
152
+ # Is the user an admin?
153
+ def admin?
154
+ @tags['badges'].include? 'admin'
155
+ end
156
+
157
+ # Is the user a global moderator?
158
+ def globalmod?
159
+ @tags['badges'].include? 'global_mod'
160
+ end
161
+
162
+ # Is the user a staff?
163
+ def staff?
164
+ @tags['badges'].include? 'staff'
165
+ end
166
+
167
+ # Get color of username in hex value if unset by user will return empty string.
168
+ def color
169
+ @tags['color']
170
+ end
171
+ end
172
+ end
173
+ # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
metadata ADDED
@@ -0,0 +1,190 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sugilite
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - MediaMagnet
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-08-29 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: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: eventmachine
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.2'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 1.2.7
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '1.2'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 1.2.7
47
+ - !ruby/object:Gem::Dependency
48
+ name: faye-websocket
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: 0.10.9
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: 0.10.9
61
+ - !ruby/object:Gem::Dependency
62
+ name: minitest
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '5.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '5.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: oj
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 3.9.0
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: 3.9.0
89
+ - !ruby/object:Gem::Dependency
90
+ name: rake
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '10.0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '10.0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: rake-compiler
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: 1.0.7
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: 1.0.7
117
+ - !ruby/object:Gem::Dependency
118
+ name: rest-client
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: 2.1.0
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: 2.1.0
131
+ description: Twitch chat client gem using websockets and twitch irc
132
+ email:
133
+ - nathanec@gmail.com
134
+ executables:
135
+ - Sugilite
136
+ extensions:
137
+ - ext/Sugilite/extconf.rb
138
+ extra_rdoc_files: []
139
+ files:
140
+ - ".gitignore"
141
+ - ".idea/Sugilite.iml"
142
+ - ".idea/misc.xml"
143
+ - ".idea/modules.xml"
144
+ - ".idea/vcs.xml"
145
+ - ".idea/workspace.xml"
146
+ - ".travis.yml"
147
+ - CODE_OF_CONDUCT.md
148
+ - Gemfile
149
+ - Gemfile.lock
150
+ - LICENSE.txt
151
+ - README.md
152
+ - Rakefile
153
+ - Sugilite.gemspec
154
+ - bin/console
155
+ - bin/setup
156
+ - exe/Sugilite
157
+ - ext/Sugilite/Sugilite.c
158
+ - ext/Sugilite/Sugilite.h
159
+ - ext/Sugilite/extconf.rb
160
+ - lib/Sugilite.rb
161
+ - lib/Sugilite/version.rb
162
+ - lib/SugiliteIRC.rb
163
+ homepage: https://gitlab.com/MediaMagnet/Sugilite
164
+ licenses:
165
+ - MIT
166
+ metadata:
167
+ allowed_push_host: https://rubygems.org
168
+ homepage_uri: https://gitlab.com/MediaMagnet/Sugilite
169
+ source_code_uri: https://gitlab.com/MediaMagnet/Sugilite
170
+ changelog_uri: https://gitlab.com/MediaMagnet/Sugilite/blob/Sugilite/CHANGELOG.md
171
+ post_install_message:
172
+ rdoc_options: []
173
+ require_paths:
174
+ - lib
175
+ required_ruby_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ required_rubygems_version: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ requirements: []
186
+ rubygems_version: 3.0.3
187
+ signing_key:
188
+ specification_version: 4
189
+ summary: Twitch chat client gem using websockets
190
+ test_files: []