From 0cfdbfb91c7bf41f69d0754e28bfbe6999012733 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Wed, 7 Jan 2015 14:44:40 -0500 Subject: [PATCH 1/3] Merge github-linguist-grammars into github-linguist Now that all our grammars are licensed (or grandfathered in), we can distribute them as part of the standard github-linguist gem. This makes it easier for projects to get up and running with Linguist. --- Gemfile | 1 - Rakefile | 8 ++------ github-linguist-grammars.gemspec | 14 -------------- github-linguist.gemspec | 3 ++- lib/linguist.rb | 1 + lib/linguist/grammars.rb | 3 --- 6 files changed, 5 insertions(+), 25 deletions(-) delete mode 100644 github-linguist-grammars.gemspec diff --git a/Gemfile b/Gemfile index c5f2cc3b..9dc1b4dc 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,3 @@ source 'https://rubygems.org' gemspec :name => "github-linguist" -gemspec :name => "github-linguist-grammars" gem 'byebug' if RUBY_VERSION >= '2.0' diff --git a/Rakefile b/Rakefile index b38486c0..186bc9c2 100644 --- a/Rakefile +++ b/Rakefile @@ -40,18 +40,14 @@ task :samples do end task :build_gem => :samples do + rm_rf "grammars" + sh "script/convert-grammars" languages = YAML.load_file("lib/linguist/languages.yml") File.write("lib/linguist/languages.json", Yajl.dump(languages)) `gem build github-linguist.gemspec` File.delete("lib/linguist/languages.json") end -task :build_grammars_gem do - rm_rf "grammars" - sh "script/convert-grammars" - sh "gem", "build", "github-linguist-grammars.gemspec" -end - namespace :benchmark do benchmark_path = "benchmark/results" diff --git a/github-linguist-grammars.gemspec b/github-linguist-grammars.gemspec deleted file mode 100644 index 429b3ff1..00000000 --- a/github-linguist-grammars.gemspec +++ /dev/null @@ -1,14 +0,0 @@ -require File.expand_path('../lib/linguist/version', __FILE__) - -Gem::Specification.new do |s| - s.name = 'github-linguist-grammars' - s.version = Linguist::VERSION - s.summary = "Language grammars for use with github-linguist" - - s.authors = "GitHub" - s.homepage = "https://github.com/github/linguist" - - s.files = ['lib/linguist/grammars.rb'] + Dir['grammars/*'] - - s.add_development_dependency 'plist', '~>3.1' -end diff --git a/github-linguist.gemspec b/github-linguist.gemspec index 983db982..974d1bc0 100644 --- a/github-linguist.gemspec +++ b/github-linguist.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |s| s.homepage = "https://github.com/github/linguist" s.license = "MIT" - s.files = Dir['lib/**/*'] - ['lib/linguist/grammars.rb'] + s.files = Dir['lib/**/*'] + Dir['grammars/*'] s.executables << 'linguist' s.add_dependency 'charlock_holmes', '~> 0.7.3' @@ -20,6 +20,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'minitest', '>= 5.0' s.add_development_dependency 'mocha' + s.add_development_dependency 'plist', '~>3.1' s.add_development_dependency 'pry' s.add_development_dependency 'rake' s.add_development_dependency 'yajl-ruby' diff --git a/lib/linguist.rb b/lib/linguist.rb index ff9fc3a2..edbd4483 100644 --- a/lib/linguist.rb +++ b/lib/linguist.rb @@ -1,5 +1,6 @@ require 'linguist/blob_helper' require 'linguist/generated' +require 'linguist/grammars' require 'linguist/heuristics' require 'linguist/language' require 'linguist/repository' diff --git a/lib/linguist/grammars.rb b/lib/linguist/grammars.rb index f6468280..b1ccbf6b 100644 --- a/lib/linguist/grammars.rb +++ b/lib/linguist/grammars.rb @@ -1,6 +1,3 @@ -# Note: This file is included in the github-linguist-grammars gem, not the -# github-linguist gem. - module Linguist module Grammars # Get the path to the directory containing the language grammar JSON files. From 23e55e92ca8a01b01f9908e77777d834b97a0f31 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Thu, 8 Jan 2015 09:19:18 -0500 Subject: [PATCH 2/3] Mention grammar licenses in LICENSE --- LICENSE | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/LICENSE b/LICENSE index f09a7d0a..7981307b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,9 @@ +The language grammars included in this gem are covered by their repositories' +respective licenses. See https://github.com/github/linguist/blob/master/grammars.yml +to determine the repository for each grammar. + +All other files are covered by the following license: + Copyright (c) 2011-2014 GitHub, Inc. Permission is hereby granted, free of charge, to any person From 5b72b4d3533fd931b183756c262158c10540d670 Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Tue, 8 Mar 2016 21:05:55 -0800 Subject: [PATCH 3/3] move note about grammar repos from LICENSE to README.md --- LICENSE | 6 ------ README.md | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/LICENSE b/LICENSE index 7981307b..f09a7d0a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,9 +1,3 @@ -The language grammars included in this gem are covered by their repositories' -respective licenses. See https://github.com/github/linguist/blob/master/grammars.yml -to determine the repository for each grammar. - -All other files are covered by the following license: - Copyright (c) 2011-2014 GitHub, Inc. Permission is hereby granted, free of charge, to any person diff --git a/README.md b/README.md index c2c803a8..2a5e7520 100644 --- a/README.md +++ b/README.md @@ -194,3 +194,11 @@ If you are the current maintainer of this gem: 0. Merge github/linguist PR 0. Tag and push: `git tag vx.xx.xx; git push --tags` 0. Push to rubygems.org -- `gem push github-linguist-3.0.0.gem` + +## License + +The language grammars included in this gem are covered by their repositories' +respective licenses. `grammars.yml` specifies the repository for each grammar. + +All other files are covered by the MIT license, see `LICENSE`. +