diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..f930ab7 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,26 @@ +PATH + remote: . + specs: + syspro (0.1.0) + faraday (~> 0.10) + +GEM + remote: https://rubygems.org/ + specs: + faraday (0.14.0) + multipart-post (>= 1.2, < 3) + minitest (5.11.3) + multipart-post (2.0.0) + rake (10.5.0) + +PLATFORMS + ruby + +DEPENDENCIES + bundler (~> 1.16) + minitest (~> 5.0) + rake (~> 10.0) + syspro! + +BUNDLED WITH + 1.16.1 diff --git a/lib/syspro.rb b/lib/syspro.rb index 5bad531..517a744 100644 --- a/lib/syspro.rb +++ b/lib/syspro.rb @@ -1,5 +1,21 @@ +require "cgi" +require "faraday" +require "json" +require "logger" +require "openssl" + require "syspro/version" +require "syspro/syspro_client" module Syspro # Your code goes here... + # + + def self.ca_store + @ca_store ||= begin + store = OpenSSL::X509::Store.new + store.add_file(ca_bundle_path) + store + end + end end diff --git a/lib/syspro/syspro_client.rb b/lib/syspro/syspro_client.rb new file mode 100644 index 0000000..9d482ee --- /dev/null +++ b/lib/syspro/syspro_client.rb @@ -0,0 +1,21 @@ +module Syspro + class SysproClient + def initialize(conn = nil) + self.conn = conn || self.class.default_conn + @system_profiler = SystemProfiler.new + end + + def self.active_client + Thread.current[:syspro_client] || default_client + end + + def self.default_client + Thread.current[:syspro_client_default_client] ||= SysproClient.new(default_conn) + end + + def get_syspro_version + + end + end +end + diff --git a/syspro.gemspec b/syspro.gemspec index 3aa441e..bd01ee7 100644 --- a/syspro.gemspec +++ b/syspro.gemspec @@ -8,7 +8,7 @@ Gem::Specification.new do |spec| spec.authors = ["Isaac Lewis"] spec.email = ["ike@wild.land"] - spec.summary = %q{Connection library for SYSPRO 7 API} + spec.summary = %q{SYSPRO 7 Api Ruby adapter} spec.license = "MIT" # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' @@ -27,6 +27,8 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] + spec.add_dependency("faraday", "~> 0.10") + spec.add_development_dependency "bundler", "~> 1.16" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "minitest", "~> 5.0" diff --git a/test/client_test.rb b/test/client_test.rb new file mode 100644 index 0000000..7af0bb8 --- /dev/null +++ b/test/client_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class SysproClientTest < Minitest::Test + def test_get_syspro_version + client = ::Syspro::SysproClient.new + refute_nil client.get_syspro_version + end +end diff --git a/test/syspro_test.rb b/test/syspro_test.rb index 59a5410..3439b45 100644 --- a/test/syspro_test.rb +++ b/test/syspro_test.rb @@ -4,8 +4,4 @@ class SysproTest < Minitest::Test def test_that_it_has_a_version_number refute_nil ::Syspro::VERSION end - - def test_it_does_something_useful - assert false - end end -- libgit2 0.21.4