some_test 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6a559b4dc275ff09008c31c785f2fac88e20ee98
4
+ data.tar.gz: 541b49cb5d7fe1c0b272cdcdffce1bad157427dd
5
+ SHA512:
6
+ metadata.gz: bcc451c924d5b036b030ce85f9de789f0e1dae3549e1d38852b211465ebadd391f257465bf8028a3ab18983fa334d59e40950b9c000949d88fa877126ec57f97
7
+ data.tar.gz: 60ec1df894a1a71bd764e9d3726c5c77ed27fc73717f685ccbdb6869f0c05df807d6964d383932385b2e31da96915f015ffcd1d5fb58945088d959ed58ddba64
data/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
data/bin/bundle ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
data/bin/rails ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ APP_PATH = File.expand_path('../config/application', __dir__)
8
+ require_relative '../config/boot'
9
+ require 'rails/commands'
data/bin/rake ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ require_relative '../config/boot'
8
+ require 'rake'
9
+ Rake.application.run
data/bin/setup ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a starting point to setup your application.
15
+ # Add necessary setup steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ # Install JavaScript dependencies if using Yarn
22
+ # system('bin/yarn')
23
+
24
+
25
+ # puts "\n== Copying sample files =="
26
+ # unless File.exist?('config/database.yml')
27
+ # cp 'config/database.yml.sample', 'config/database.yml'
28
+ # end
29
+
30
+ puts "\n== Preparing database =="
31
+ system! 'bin/rails db:setup'
32
+
33
+ puts "\n== Removing old logs and tempfiles =="
34
+ system! 'bin/rails log:clear tmp:clear'
35
+
36
+ puts "\n== Restarting application server =="
37
+ system! 'bin/rails restart'
38
+ end
data/bin/spring ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast.
4
+ # It gets overwritten when you run the `spring binstub` command.
5
+
6
+ unless defined?(Spring)
7
+ require 'rubygems'
8
+ require 'bundler'
9
+
10
+ lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11
+ spring = lockfile.specs.detect { |spec| spec.name == "spring" }
12
+ if spring
13
+ Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
14
+ gem 'spring', spring.version
15
+ require 'spring/binstub'
16
+ end
17
+ end
data/bin/update ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a way to update your development environment automatically.
15
+ # Add necessary update steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ puts "\n== Updating database =="
22
+ system! 'bin/rails db:migrate'
23
+
24
+ puts "\n== Removing old logs and tempfiles =="
25
+ system! 'bin/rails log:clear tmp:clear'
26
+
27
+ puts "\n== Restarting application server =="
28
+ system! 'bin/rails restart'
29
+ end
data/bin/yarn ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ VENDOR_PATH = File.expand_path('..', __dir__)
3
+ Dir.chdir(VENDOR_PATH) do
4
+ begin
5
+ exec "yarnpkg #{ARGV.join(" ")}"
6
+ rescue Errno::ENOENT
7
+ $stderr.puts "Yarn executable was not detected in the system."
8
+ $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9
+ exit 1
10
+ end
11
+ end
Binary file
@@ -0,0 +1,9 @@
1
+ class CreateSites < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :sites do |t|
4
+ t.string :domain
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ class CreatePages < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :pages do |t|
4
+ t.integer :site_id
5
+ t.string :url
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ class CreateMetrics < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :metrics do |t|
4
+ t.integer :page_id
5
+ t.date :date
6
+ t.integer :shares
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
data/db/schema.rb ADDED
@@ -0,0 +1,36 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # Note that this schema.rb definition is the authoritative source for your
6
+ # database schema. If you need to create the application database on another
7
+ # system, you should be using db:schema:load, not running all the migrations
8
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(version: 20170623100435) do
14
+
15
+ create_table "metrics", force: :cascade do |t|
16
+ t.integer "page_id"
17
+ t.date "date"
18
+ t.integer "shares"
19
+ t.datetime "created_at", null: false
20
+ t.datetime "updated_at", null: false
21
+ end
22
+
23
+ create_table "pages", force: :cascade do |t|
24
+ t.integer "site_id"
25
+ t.string "url"
26
+ t.datetime "created_at", null: false
27
+ t.datetime "updated_at", null: false
28
+ end
29
+
30
+ create_table "sites", force: :cascade do |t|
31
+ t.string "domain"
32
+ t.datetime "created_at", null: false
33
+ t.datetime "updated_at", null: false
34
+ end
35
+
36
+ end
data/db/seeds.rb ADDED
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
7
+ # Character.create(name: 'Luke', movie: movies.first)
data/db/test.sqlite3 ADDED
File without changes
@@ -0,0 +1,29 @@
1
+ require 'nokogiri'
2
+ require 'json'
3
+
4
+ namespace :meter do
5
+
6
+ desc "Show facebook shares count"
7
+
8
+ task :parse, [:addr, :limit] => [:environment] do |t, args|
9
+
10
+ #
11
+ # sitemap = Nokogiri::XML(open("https://www.#{site.domain}/sitemap.xml"))
12
+ # puts sitemap
13
+
14
+ # item = sitemap.css('loc')
15
+ #
16
+ # item.each do |nod|
17
+ # fb_resp = Nokogiri::XML(open("https://graph.facebook.com/?ids=#{nod.inner_text}"))
18
+ # Page.create(url: nod.inner_text)
19
+ # Metric.create(shares: fb_resp)
20
+ #
21
+ # puts fb_resp
22
+ # end
23
+ # FbSharesWorker.perform_async(args)
24
+ site = Site.create(domain: args['addr'])
25
+
26
+ site.findSitemap
27
+ end
28
+
29
+ end
@@ -0,0 +1,26 @@
1
+ require 'nokogiri'
2
+ require 'json'
3
+ namespace :some_test do
4
+ desc "Show facebook shares count _2"
5
+
6
+ task :parse, [:addr, :limit] => [:environment] do |t, args|
7
+
8
+ #
9
+ # sitemap = Nokogiri::XML(open("https://www.#{site.domain}/sitemap.xml"))
10
+ # puts sitemap
11
+
12
+ # item = sitemap.css('loc')
13
+ #
14
+ # item.each do |nod|
15
+ # fb_resp = Nokogiri::XML(open("https://graph.facebook.com/?ids=#{nod.inner_text}"))
16
+ # Page.create(url: nod.inner_text)
17
+ # Metric.create(shares: fb_resp)
18
+ #
19
+ # puts fb_resp
20
+ # end
21
+ # FbSharesWorker.perform_async(args)
22
+ site = Site.create(domain: args['addr'])
23
+
24
+ site.findSitemap
25
+ end
26
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: some_test
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Webinar LTD
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-06-24 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - README.md
20
+ - bin/bundle
21
+ - bin/rails
22
+ - bin/rake
23
+ - bin/setup
24
+ - bin/spring
25
+ - bin/update
26
+ - bin/yarn
27
+ - db/development.sqlite3
28
+ - db/migrate/20170620171609_create_sites.rb
29
+ - db/migrate/20170623100101_create_pages.rb
30
+ - db/migrate/20170623100435_create_metrics.rb
31
+ - db/schema.rb
32
+ - db/seeds.rb
33
+ - db/test.sqlite3
34
+ - lib/tasks/meter.rake
35
+ - lib/tasks/some_test.rake
36
+ homepage:
37
+ licenses: []
38
+ metadata: {}
39
+ post_install_message:
40
+ rdoc_options: []
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ requirements: []
54
+ rubyforge_project:
55
+ rubygems_version: 2.5.1
56
+ signing_key:
57
+ specification_version: 4
58
+ summary: test
59
+ test_files: []